libpgtcl and Tcl 8.0

Started by Horak Danielover 27 years ago3 messages
#1Horak Daniel
horak@mmp.plzen-city.cz

Hello,

I have problem with compiling of libpgtcl in current snapshot of PGSQL.
I think, there is a problem with compatibility of Tcl versions 7.x and
8.x.

system=Linux 2.0.35, RedHat 5.1, Tcl 8.0.2

following items are from notes in Tcl 8.0
- Tcl_CreateFileHandler and Tcl_DeleteFileHandler now take Unix fd's and
are only supported on the Unix platform.

- The C APIs for creating channel drivers have changed as part
of the new notifier implementation. The Tcl_File interfaces have
been removed. Tcl_GetChannelFile has been replaced with
Tcl_GetChannelHandle. Tcl_MakeFileChannel now takes
a platform-specific file handle.

libpgtcl uses Tcl_File interfaces when compiling with Tcl >= 7.6. Simply
reversing the condition doesn't help.

Is anybody working on this problem? Or must we use Tcl 7.6?

Thank you
Dan Horak

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Horak Daniel (#1)
Re: [HACKERS] libpgtcl and Tcl 8.0

Horak Daniel <horak@mmp.plzen-city.cz> writes:

following items are from notes in Tcl 8.0
- The C APIs for creating channel drivers have changed as part

Again? Sheesh.

Is anybody working on this problem? Or must we use Tcl 7.6?

I'm not going to do anything about it in the immediate future.
Do you want to submit patches? Please do not break the Tcl 7.6 support.

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: [HACKERS] libpgtcl and Tcl 8.0

Horak Daniel <horak@mmp.plzen-city.cz> writes:

[I wrote]

Say, do you know whether the 6.3.2 Postgres release worked OK with
Tcl 8? If so, it might just be that pgtclId.h needs to set
HAVE_TCL_GETFILEPROC to 0 for Tcl 8.

I have tried this, but doesn't work. In current libpgtcl there are used
functions Tcl_GetFile, Tcl_WatchFile, Tcl_FileReady. These aren't
defined in Tcl 8.0 C interface.

Grumble. So they redid the I/O interfaces (again).

This means that the current libpgtcl is broken under Tcl 8, which is not
good ... especially since 6.3.2's wasn't; it didn't use these functions,
because it didn't support asynchronous NOTIFY.

I will put this on my TODO list --- it won't get done before 1 Sept, but
hopefully this qualifies as a bug fix that I can sneak in before 6.4
release ;-)

As a short-term workaround you should be able to run under Tcl 8 by
doing the following:
1. Fix pgtclId.h so that HAVE_TCL_GETFILEPROC is set to 0 for Tcl 8.
2. In pgtclId.c, make Pg_Notify_SetupProc be an empty function
(just delete all the contents);
3. and in Pg_Notify_CheckProc, delete the calls to Tcl_GetFile and
Tcl_FileReady (make the call to PQconsumeInput unconditional).

This should more or less work, except that Tcl won't notice an
asynchronous NOTIFY message until something else happens (like
a keystroke or mouse movement).

regards, tom lane