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
thecommand
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