Thread: Which Interface with Windows

Which Interface with Windows

From
"Jason C. Wells"
Date:
Where would you advise a TCL noob to start when considering TCL interfaces
for postgresql?

I am pretty sure that pgin.tcl is the way I will go, but I lack the
confidence owing to my noobness.  If someone would pat me on the head and
tell me, "You can't go wrong with pgin.tcl" I would be much obliged.

I have had trouble with libpgtcl because of the availability of windows
libraries.  I tried pgin.tcl and it "just worked" and that groovy to me.

Perhaps libpq.dll and libpgtcl.dll are available and current somewhere
that I have not noticed.  The only place I found them was in the pgaccess
distribution which seems to be getting stale.  Any pointers to binary
windows DLLs?

I could always fall back on PHP, but I kind of want to venture into TCL
and this seems like a great way to get started.

Thanks,
Jason C. Wells





Re: Which Interface with Windows (libpgtcl)

From
L J Bayuk
Date:
Jason C. Wells wrote:
> 
> Where would you advise a TCL noob to start when considering TCL interfaces
> for postgresql?
> 
> I am pretty sure that pgin.tcl is the way I will go, but I lack the
> confidence owing to my noobness.  If someone would pat me on the head and
> tell me, "You can't go wrong with pgin.tcl" I would be much obliged.

Sorry, I won't tell you "You can't go wrong with pgin.tcl", and I'm the
one who wrote it... 

> I have had trouble with libpgtcl because of the availability of windows
> libraries.  I tried pgin.tcl and it "just worked" and that groovy to me.
>
> Perhaps libpq.dll and libpgtcl.dll are available and current somewhere
> that I have not noticed.  The only place I found them was in the pgaccess
> distribution which seems to be getting stale.  Any pointers to binary
> windows DLLs?

No, you are right, I don't think they are available, but stay tuned to
this list regarding libpgtcl and Windows.

> I could always fall back on PHP, but I kind of want to venture into TCL
> and this seems like a great way to get started.

Here's my advice. If you are serving web pages from PostgreSQL data, and
aren't committed to Tcl for some reason, and are on a platform where you
can get or build the PostgreSQL PHP interface: no contest, go with PHP.
As much as I like Tcl, PHP is a much better language for serving web pages,
and the PostgreSQL PHP module is really solid.

If you are going to use Tcl: On non-Windows platforms, use the bundled
libpgtcl included with PostgreSQL. On Windows platforms, use pgin.tcl.
Either way, stick with the core commands (no asynchronous, do not use COPY
FROM/COPY TO). Now your Tcl code is compatible with the bundled libpgtcl,
and with pgin.tcl 1.x (talks to PostgreSQL 7.3 servers, and 7.4 in
down-level protocol mode).  In the (hopefully) very near future, your code
will also be compatible with pgin.tcl 2.x (currently beta, talks to
PostgreSQL 7.4 servers only, with the latest protocol). And in the
(hopefully) not so distant future, it will be compatible with a new
unbundled libpgtcl, which will also be available as Borland-compiled DLLs
for Windows.


Re: Which Interface with Windows (libpgtcl)

From
"Jason C. Wells"
Date:
On Tue, 3 Feb 2004, L J Bayuk wrote:

> Here's my advice. If you are serving web pages from PostgreSQL data, and
> aren't committed to Tcl for some reason, and are on a platform where you
> can get or build the PostgreSQL PHP interface: no contest, go with PHP.
> As much as I like Tcl, PHP is a much better language for serving web pages,
> and the PostgreSQL PHP module is really solid.

I am not serving webpages per se.  I could run the app in the browser and
have the same outcome as running the app in the TK window.  I think the
richer UI features of TK are worth examining.  Plus, this is an
exploratory foray into writing scripts under windows.  With my current
database and document library, I find myself doing the same things over
and over.  That's a job for scripting!

And thanks for all your other pointers.  I'll try to stay away from the
gotchas that you mentioned.

Thanks,
Jason C. Wells