From: Jan Wieck <janwieck@yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Padgaonkar <amit@nsat.co.jp>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Cant load pgtclsh library into application
Date: Wed, 5 Dec 2001 16:44:07 -0500 (EST)
Message-ID: <200112052144.fB5Li7e02083@saturn.jw.home> (raw)
In-Reply-To: <19220.1006877462@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: janwieck@yahoo.com, tgl@sss.pgh.pa.us, amit@nsat.co.jp, pgsql-interfaces@postgresql.org
Subject: Re: Cant load pgtclsh library into application
In-Reply-To: <200112052144.fB5Li7e02083@saturn.jw.home>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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