pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cant load pgtclsh library into application
3+ messages / 3 participants
[nested] [flat]

* Cant load pgtclsh library into application
@ 2001-11-27 07:10  Amit Padgaonkar <amit@nsat.co.jp>
  0 siblings, 1 reply; 3+ messages in thread

From: Amit Padgaonkar @ 2001-11-27 07:10 UTC (permalink / raw)
  To: pgsql-interfaces@postgresql.org

Hi Guys,
            I have just begun coding in tcl/tk and hence sorry for this
simple question.
            I am using tcl8.3 / tk8.3  and postgreSQL 7.3 . I am not able to
load pgtclsh library into to my TK application for giving it backend
support.
            Can you please suggest me how to proceed?

Thanks,
           Amit
----- Original Message -----
From: "Patrick Welche" <prlw1@newn.cam.ac.uk>
To: "Joe Conway" <joseph.conway@home.com>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Wednesday, November 21, 2001 9:25 PM
Subject: Re: [INTERFACES] [PATCHES] PQescapeBytea documentation patch


> On Tue, Nov 20, 2001 at 12:21:00PM -0800, Joe Conway wrote:
> > Here's a patch adding documentation for the PQescapeBytea function to
> > libpq.sgml
> ...
> +    <function>PQescapeBytea</function>
> +    Escapes a binary string (bytea type) for use within an SQL query.
> +    <synopsis>
> +     unsigned char *PQescapeBytea(unsigned char *from,
> +                                          size_t from_length,
> +                                          size_t *to_length);
>
>
> This makes me wonder: should libpq contain a function to do the opposite
> too? eg.
>
> string=GetValue(from a bytea type column)
> PQunescapeBytea(string, some buffer, buffer's size)
>
> - or is there already another way of doing it?
>
> It seems to me that anyone using bytea with libpq will end up having
> to reinvent this wheel. (Something worthy of being knocked up in my
> Copious Free Time (tm))
>
> Cheers,
>
> Patrick
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Cant load pgtclsh library into application
@ 2001-11-27 16:11  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Amit Padgaonkar <amit@nsat.co.jp>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2001-11-27 16:11 UTC (permalink / raw)
  To: Amit Padgaonkar <amit@nsat.co.jp>; +Cc: pgsql-interfaces@postgresql.org

"Amit Padgaonkar" <amit@nsat.co.jp> writes:
>             I am using tcl8.3 / tk8.3  and postgreSQL 7.3 . I am not able to
> load pgtclsh library into to my TK application for giving it backend
> support.

pgtclsh is not a library, it is a prebuilt tclsh application with the
libpgtcl library already loaded into it.  You can load the libpgtcl
library into your own application with the usual Tcl "load" command.
pgaccess does it like so:

	if {[info exists env(PGLIB)]} {
		set libpgtclpath [file join $env(PGLIB) libpgtcl]
	} else {
		set libpgtclpath {libpgtcl}
	}
	load ${libpgtclpath}[info sharedlibextension]

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Cant load pgtclsh library into application
@ 2001-12-05 21:44  Jan Wieck <janwieck@yahoo.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Jan Wieck @ 2001-12-05 21:44 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Amit Padgaonkar <amit@nsat.co.jp>; pgsql-interfaces@postgresql.org

Tom Lane wrote:
> "Amit Padgaonkar" <amit@nsat.co.jp> writes:
> >             I am using tcl8.3 / tk8.3  and postgreSQL 7.3 . I am not able to
> > load pgtclsh library into to my TK application for giving it backend
> > support.
>
> pgtclsh is not a library, it is a prebuilt tclsh application with the
> libpgtcl library already loaded into it.  You can load the libpgtcl
> library into your own application with the usual Tcl "load" command.
> pgaccess does it like so:
>
>    if {[info exists env(PGLIB)]} {
>         set libpgtclpath [file join $env(PGLIB) libpgtcl]
>    } else {
>         set libpgtclpath {libpgtcl}
>    }
>    load ${libpgtclpath}[info sharedlibextension]
>
>              regards, tom lane

    I  use to have a directory .../tcl8.x/lib/pgtcl where I put a
    symlink to the libpgtcl.so and the  appropriate  pgkIndex.tcl
    file.   The  pgkIndex  can  be  created  by  cd'ing into that
    directory, starting a tclsh and issuing the command

        pkg_mkIndex . ./libpgtcl.so

    Once you have that, your Tcl scripts just need to do a

        package require Pgtcl

    No need for the user to set PGLIB or even know  where  it  is
    installed.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-12-05 21:44 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-27 07:10 Cant load pgtclsh library into application Amit Padgaonkar <amit@nsat.co.jp>
2001-11-27 16:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-12-05 21:44   ` Jan Wieck <janwieck@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox