Re: Building libpq/psql with Borland BCC5

Lists: pgsql-hackerspgsql-patches
From: L Bayuk <lbayuk(at)pobox(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Building libpq/psql with Borland BCC5
Date: 2007-01-10 02:32:33
Message-ID: 20070110023233.GA539@mail.mindspring.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
and psql*. There are also changes to some header files to hide some things
BCC doesn't like.

*Note: psql compiles with bcc after the patch, but it does not run very well.

Attachment Content-Type Size
pg821-bcc.patch text/plain 9.2 KB

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: L Bayuk <lbayuk(at)pobox(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Building libpq/psql with Borland BCC5
Date: 2007-01-10 02:43:05
Message-ID: Pine.LNX.4.58.0701101342400.14885@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Tue, 9 Jan 2007, L Bayuk wrote:

> The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> and psql*. There are also changes to some header files to hide some things
> BCC doesn't like.
>
> *Note: psql compiles with bcc after the patch, but it does not run very well.
>

Define "does not run very well" :-)

Gavin


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Building libpq/psql with Borland BCC5
Date: 2007-01-10 03:04:33
Message-ID: 200701100304.l0A34Xa10520@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Gavin Sherry wrote:
> On Tue, 9 Jan 2007, L Bayuk wrote:
>
> > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > and psql*. There are also changes to some header files to hide some things
> > BCC doesn't like.
> >
> > *Note: psql compiles with bcc after the patch, but it does not run very well.
> >
>
> Define "does not run very well" :-)

See:

http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Building libpq/psql with Borland BCC5
Date: 2007-01-10 03:53:01
Message-ID: Pine.LNX.4.58.0701101448070.17279@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Tue, 9 Jan 2007, Bruce Momjian wrote:

> Gavin Sherry wrote:
> > On Tue, 9 Jan 2007, L Bayuk wrote:
> >
> > > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > > and psql*. There are also changes to some header files to hide some things
> > > BCC doesn't like.
> > >
> > > *Note: psql compiles with bcc after the patch, but it does not run very well.
> > >
> >
> > Define "does not run very well" :-)
>
> See:
>
> http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php
>

*blinks*

Can we be sure that a BCC build libpq is even safe to use given the
problems seen when using psql?

Gavin


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Building libpq/psql with Borland BCC5
Date: 2007-01-10 03:53:47
Message-ID: 200701100353.l0A3rlE18285@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Gavin Sherry wrote:
> On Tue, 9 Jan 2007, Bruce Momjian wrote:
>
> > Gavin Sherry wrote:
> > > On Tue, 9 Jan 2007, L Bayuk wrote:
> > >
> > > > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > > > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > > > and psql*. There are also changes to some header files to hide some things
> > > > BCC doesn't like.
> > > >
> > > > *Note: psql compiles with bcc after the patch, but it does not run very well.
> > > >
> > >
> > > Define "does not run very well" :-)
> >
> > See:
> >
> > http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php
> >
>
> *blinks*
>
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

The bcc users say it is.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Building libpq/psql with Borland BCC5
Date: 2007-01-10 05:18:46
Message-ID: 27797.1168406326@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

Well, I'd not trust it a lot, but surely we have to get it to build
before anyone can debug it ...

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-10 16:22:52
Message-ID: 200701101622.l0AGMqk23798@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > Can we be sure that a BCC build libpq is even safe to use given the
> > problems seen when using psql?
>
> Well, I'd not trust it a lot, but surely we have to get it to build
> before anyone can debug it ...

It does build, but the report is that psql crashes after a few commands.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-10 16:36:26
Message-ID: 20070110163626.GB25783@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
> > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > Can we be sure that a BCC build libpq is even safe to use given the
> > > problems seen when using psql?
> >
> > Well, I'd not trust it a lot, but surely we have to get it to build
> > before anyone can debug it ...
>
> It does build, but the report is that psql crashes after a few commands.

What about a Mingw or VC++ psql with a BCC libpq? Is it possible to
link something like that?

It would be nice to have the libpq at least able to pass the regression
tests.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, L Bayuk <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-10 16:45:17
Message-ID: 200701101645.l0AGjHZ26738@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > > Can we be sure that a BCC build libpq is even safe to use given the
> > > > problems seen when using psql?
> > >
> > > Well, I'd not trust it a lot, but surely we have to get it to build
> > > before anyone can debug it ...
> >
> > It does build, but the report is that psql crashes after a few commands.
>
> What about a Mingw or VC++ psql with a BCC libpq? Is it possible to
> link something like that?

No idea.

> It would be nice to have the libpq at least able to pass the regression
> tests.

True.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, "L Bayuk" <lbayuk(at)pobox(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-10 20:17:40
Message-ID: b42b73150701101217t79342b61l7038a2c2352ecac3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On 1/10/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:

> What about a Mingw or VC++ psql with a BCC libpq? Is it possible to
> link something like that?
>
> It would be nice to have the libpq at least able to pass the regression
> tests.

you can use microsoft/mingw compiled DLL files but not library files.
however, borland provides a command line tool (implib i thnk) to
create an import library for it which works ok. (i think you have to
pass a switch to fix underscore issue).

libpq.lib is not directly usable (coff vs. omf) but digital mars makes
a tool which can do this and I have confirmed it works.

note: I've used borland compiled libpq (not psql) with borland C++
builder 3 & 5 with no problems. I had to hack pg_config.h however.

merlin


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: L Bayuk <lbayuk(at)pobox(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-11 02:40:38
Message-ID: 200701110240.l0B2ec909276@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


Patch applied. Thanks.

Backpatch to 8.2.X.z

---------------------------------------------------------------------------

L Bayuk wrote:
> The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> and psql*. There are also changes to some header files to hide some things
> BCC doesn't like.
>
> *Note: psql compiles with bcc after the patch, but it does not run very well.

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: L Bayuk <lbayuk(at)pobox(dot)com>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] Building libpq/psql with Borland BCC5
Date: 2007-01-11 03:06:08
Message-ID: 20070111030608.GA602@mail.mindspring.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Wed, Jan 10, 2007 at 02:53:01PM +1100, Gavin Sherry wrote:
>...
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

I have high confidence in my BCC-built libpq, in so far as its functions
are exposed through the Tcl interface pgtcl-ng. My test suite for pgtcl
is rather thorough (more below), and it passes using BCC-built libpq.

Compare that to the fact that my BCC-built psql crashes consistently after
six "\h set" commands - which don't even use libpq! - and you can see why I
think the problem is entirely in psql.

BCC was free to use and easy to set up, and I was able to make Tcl-loadable
modules with it, so that's what I'm using for pgtcl-ng. I'm not suggesting
people use it for anything else based on what I've done. If there is a
regression test for libpq which does not use psql, show me and I'll run it.
Otherwise, people will have to do their own testing. But in my opinion if
you have Mingw or VC++, use it (not that I've used either).

.....
My test suite exercises libpq/pgtcl. I use it for pgtclng and pgintcl (see
pgfoundry). It runs about 160 test cases on Windows (more on Linux, where
it tests for memory leaks, but I don't know how to do that on Windows). It
includes: synchronous and asynchronous queries, extended 8-bit characters,
COPY From/To, cursors with text and binary data, error detection, prepared
and parameterized queries (text and binary data), large objects, long TEXT
fields, 300-column table queries, transactions, and more. I have some
performance tests in there as a sanity check, including my favorite: a
single query against a 1-column 10-row table which takes 3-10 minutes of
backend time.

Three tests claim to fail on Windows, same as always. Changes to
environment variables like PGUSER within the script are not seen by
pg_connect; this is apparently a DLL thing. The other 2 failures are
false, and have to do with a limitation of tcltest not seeing output
notification messages written by libpq. These are not real errors.