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$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
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
and
> 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
http://tcl.activestate.com/software/tclhttpd/technotes.html
and http://tcl.activestate.com:8002/resource/software/extensions/database/

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:
http://field.medicine.adelaide.edu.au/~colin/libtclpq/
and ftp://coldstore.sourceforge.net/pub/coldstore/libtclpq-20010120.tgz

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

--
Eddy Grabczewski
eddy(at)polonia(dot)co(dot)uk

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:10073(dot)988779464(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> 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
Tcl_CreateFileHandler
> > 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?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Responses

Browse pgsql-interfaces by date

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