Re: Cant load pgtclsh library into application

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amit Padgaonkar <amit(at)nsat(dot)co(dot)jp>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Cant load pgtclsh library into application
Date: 2001-12-05 21:44:07
Message-ID: 200112052144.fB5Li7e02083@saturn.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-interfaces pgsql-patches

Tom Lane wrote:
> "Amit Padgaonkar" <amit(at)nsat(dot)co(dot)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(at)Yahoo(dot)com #

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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message TONY J.Y. 2001-12-05 22:48:52 Can not get large cursor for PGLIB ???
Previous Message Jan Wieck 2001-12-05 21:29:04 Re: PL/pgSQL examples NOT involving functions

Browse pgsql-interfaces by date

  From Date Subject
Next Message TONY J.Y. 2001-12-05 22:48:52 Can not get large cursor for PGLIB ???
Previous Message Tom Lane 2001-12-04 15:11:56 Re: Operator class and index

Browse pgsql-patches by date

  From Date Subject
Next Message TONY J.Y. 2001-12-05 22:48:52 Can not get large cursor for PGLIB ???
Previous Message Bruce Momjian 2001-12-05 18:25:34 Re: small patch to contrib/rtree_gist