Skip site navigation (1) Skip section navigation (2)

Re: libpgtcl and WinNT

From: "Edward Grabczewski" <xye85(at)dial(dot)pipex(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpgtcl and WinNT
Date: 2001-05-09 01:00:03
Message-ID: 9da4q7$148f$ (view raw or whole thread)
Lists: pgsql-interfaces
I've just had an interesting reply from Kevin Kenny re the broken library
which Tom Lane commented on recently. I'm not experienced enought in TK/TCL
API programming yet to understand the answer fully but could someone comment
on the possibility of parching up the libarary based on this comment?

Edward Grabczewski wrote:
> Does anyone know why TCL 8 stopped supporiting the Tcl_CreateFileHandler
> Tcl_DeleteFileHandler functions which were in Tcl 7? Unfortunately, the
> Windows version of the PostgreSQL Tcl library - pgtcl.lib - requires these
> two functions and it's not possible to compile these libraries any more.

The functions themselves were not portable to non-Unix platforms.  The
capability of establishing callbacks on a file is still available; the
functions are named Tcl_CreateChannelHandler and Tcl_DeleteChannelHandler.

In the usual case, old code that used Tcl_CreateFileHandler and
Tcl_DeleteFileHandler was waiting for I/O on a socket.  The way to port
this forward is to wrap a Tcl_Channel around the socket by calling
Tcl_MakeTcpClientChannel.  The function name is a bit of a misnomer, since
it works just fine for sockets that use other protocols.  You don't
need to use channel-based I/O; it's fine to do 'recvfrom', 'read',
'send', 'write', or whatever in the channel handler as long as you
don't mix it with Tcl_Read, etc.

Also, I've heard that libtclpq does somewhat better on modern Tcl releases.
There are pointers to it on

but both of them are pointing to hosts that my DNS won't resolve at the
moment, probably because of electrical outages elsewhere on the Internet.

The links are:

in case you have better luck than I.
73 de ke9tv/2, Kevin KENNY GE Corporate R&D, Niskayuna, New York, USA

Eddy Grabczewski

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
> Ludek Finstrle <xfinstrl(at)informatics(dot)muni(dot)cz> writes:
> >   I have compilation problem with libpgtcl from postgresql 7.1 on WinNT.
> > The problem was that Tcl/Tk under WinNT doesn't support
> > and Tcl_DeleteFileHandler functions.
> Yup.  This is not new in 7.1, it's been like that since Tcl 8.0 came
> out.
> In their infinite(?) wisdom, the Tcl boys removed all cross-platform
> support for waiting for socket input in Tcl 8.0.  Presently libpgtcl
> depends on Tcl_CreateFileHandler which is a Unix-only API.  Feel free
> to contribute code to implement a Windows-compatible solution (maybe
> even a Mac-compatible-too solution, like we used to have pre-Tcl-8).
> Or rattle the cage over in Tcl land till they get some sense knocked
> back into them.  Or something.  But right now it's busted.
> regards, tom lane
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?

In response to


pgsql-interfaces by date

Next:From: Hiroshi InoueDate: 2001-05-09 01:11:50
Subject: Re: Re: [INTERFACES] Postgres odbc driver bug
Previous:From: Scott MuirDate: 2001-05-08 23:51:02
Subject: PGAccess in ver 7.1x

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group