Re: [pgsql-patches] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread Bruce Momjian
Tom Lane wrote:
 Gavin Sherry [EMAIL PROTECTED] 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   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [pgsql-patches] [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread Alvaro Herrera
Bruce Momjian wrote:
 Tom Lane wrote:
  Gavin Sherry [EMAIL PROTECTED] 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 Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [pgsql-patches] [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread Bruce Momjian
Alvaro Herrera wrote:
 Bruce Momjian wrote:
  Tom Lane wrote:
   Gavin Sherry [EMAIL PROTECTED] 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   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [pgsql-patches] [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread Merlin Moncure

On 1/10/07, Alvaro Herrera [EMAIL PROTECTED] 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

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [pgsql-patches] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread Bruce Momjian

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   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [pgsql-patches] [PATCHES] Building libpq/psql with Borland BCC5

2007-01-10 Thread L Bayuk
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.

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[PATCHES] Building libpq/psql with Borland BCC5

2007-01-09 Thread L Bayuk
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.
diff -c -r src.orig/bin/psql/bcc32.mak src/bin/psql/bcc32.mak
*** src.orig/bin/psql/bcc32.mak Tue Nov 21 18:26:47 2006
--- src/bin/psql/bcc32.mak  Tue Jan  9 12:17:48 2007
***
*** 60,66 
  !endif
  REFDOCDIR=../../../doc/src/sgml/ref
  
! CPP_PROJ = 
-I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32 \
 -c -D$(USERDEFINES) -DFRONTEND -n$(INTDIR) -tWM -tWC -q -5 -a8 
-pc -X -w-use \
   -w-par -w-pia -w-csu -w-aus -w-ccc
  
--- 60,66 
  !endif
  REFDOCDIR=../../../doc/src/sgml/ref
  
! CPP_PROJ = 
-I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32;..\..\include\port\win32_msvc;..\pg_dump;..\..\backend
 \
 -c -D$(USERDEFINES) -DFRONTEND -n$(INTDIR) -tWM -tWC -q -5 -a8 
-pc -X -w-use \
   -w-par -w-pia -w-csu -w-aus -w-ccc
  
***
*** 98,103 
--- 98,104 
[EMAIL PROTECTED] $(INTDIR)\mbprint.obj
[EMAIL PROTECTED] $(INTDIR)\print.obj
[EMAIL PROTECTED] $(INTDIR)\prompt.obj
+   [EMAIL PROTECTED] $(INTDIR)\psqlscan.obj
[EMAIL PROTECTED] $(INTDIR)\startup.obj
[EMAIL PROTECTED] $(INTDIR)\stringutils.obj
[EMAIL PROTECTED] $(INTDIR)\tab-complete.obj
***
*** 105,113 
--- 106,118 
[EMAIL PROTECTED] $(INTDIR)\exec.obj
[EMAIL PROTECTED] $(INTDIR)\getopt.obj
[EMAIL PROTECTED] $(INTDIR)\getopt_long.obj
+   [EMAIL PROTECTED] $(INTDIR)\snprintf.obj
[EMAIL PROTECTED] $(INTDIR)\path.obj
+   [EMAIL PROTECTED] $(INTDIR)\strlcpy.obj
[EMAIL PROTECTED] $(INTDIR)\pgstrcasecmp.obj
[EMAIL PROTECTED] $(INTDIR)\sprompt.obj
+   [EMAIL PROTECTED] $(INTDIR)\dumputils.obj
+   [EMAIL PROTECTED] $(INTDIR)\keywords.obj
[EMAIL PROTECTED] $(INTDIR)\psql.ilc
[EMAIL PROTECTED] $(INTDIR)\psql.ild
[EMAIL PROTECTED] $(INTDIR)\psql.tds
***
*** 138,146 
$(INTDIR)\exec.obj \
$(INTDIR)\getopt.obj \
$(INTDIR)\getopt_long.obj \
$(INTDIR)\path.obj \
$(INTDIR)\pgstrcasecmp.obj \
!   $(INTDIR)\sprompt.obj
  
  !IFDEF DEBUG
  LINK32_OBJS   = $(LINK32_OBJS) ..\..\interfaces\libpq\Debug\blibpqddll.lib
--- 143,155 
$(INTDIR)\exec.obj \
$(INTDIR)\getopt.obj \
$(INTDIR)\getopt_long.obj \
+   $(INTDIR)\snprintf.obj \
$(INTDIR)\path.obj \
+   $(INTDIR)\strlcpy.obj \
$(INTDIR)\pgstrcasecmp.obj \
!   $(INTDIR)\sprompt.obj \
!   $(INTDIR)\dumputils.obj \
!   $(INTDIR)\keywords.obj 
  
  !IFDEF DEBUG
  LINK32_OBJS   = $(LINK32_OBJS) ..\..\interfaces\libpq\Debug\blibpqddll.lib
***
*** 149,155 
  !ENDIF
  
  # Have to use \# so # isn't treated as a comment, but MSVC doesn't like this
! ..\..\port\pg_config_paths.h: win32.mak
echo \#define PGBINDIR  $@
echo \#define PGSHAREDIR  $@
echo \#define SYSCONFDIR  $@
--- 158,164 
  !ENDIF
  
  # Have to use \# so # isn't treated as a comment, but MSVC doesn't like this
! ..\..\port\pg_config_paths.h: bcc32.mak
echo \#define PGBINDIR  $@
echo \#define PGSHAREDIR  $@
echo \#define SYSCONFDIR  $@
***
*** 188,198 
--- 197,217 
  $(CPP_PROJ) ..\..\port\getopt_long.c
  
  
+ $(INTDIR)\snprintf.obj : $(INTDIR) ..\..\port\snprintf.c
+ $(CPP) @
+ $(CPP_PROJ) ..\..\port\snprintf.c
+ 
+ 
  $(INTDIR)\path.obj : $(INTDIR) ..\..\port\path.c
  $(CPP) @
  $(CPP_PROJ) ..\..\port\path.c
  
  
+ $(INTDIR)\strlcpy.obj : $(INTDIR) ..\..\port\strlcpy.c
+ $(CPP) @
+ $(CPP_PROJ) ..\..\port\strlcpy.c
+ 
+ 
  $(INTDIR)\pgstrcasecmp.obj : ..\..\port\pgstrcasecmp.c
  $(CPP) @
  $(CPP_PROJ) ..\..\port\pgstrcasecmp.c
***
*** 203,208 
--- 222,237 
  $(CPP_PROJ) ..\..\port\sprompt.c
  
  
+ $(INTDIR)\dumputils.obj : $(INTDIR) ..\pg_dump\dumputils.c
+ $(CPP) @
+ $(CPP_PROJ) ..\pg_dump\dumputils.c
+ 
+ 
+ $(INTDIR)\keywords.obj : $(INTDIR) ..\..\backend\parser\keywords.c
+ $(CPP) @
+ $(CPP_PROJ) ..\..\backend\parser\keywords.c
+ 
+ 
  sql_help.h: create_help.pl 
 $(PERL) create_help.pl $(REFDOCDIR) $@
  
diff -c -r src.orig/include/c.h src/include/c.h
*** src.orig/include/c.hTue Oct  3 20:30:06 2006
--- src/include/c.h Tue Jan  9 12:18:57 2007
***
*** 59,65 
  #include postgres_ext.h
  #include pg_trace.h
  
! #if defined(__BORLANDC__) || (_MSC_VER = 1400)
  #define errcode __msvc_errcode
  #include crtdefs.h
  #undef errcode
--- 59,65 
  #include postgres_ext.h
  #include pg_trace.h
  
! #if _MSC_VER = 1400
  #define errcode 

Re: [PATCHES] Building libpq/psql with Borland BCC5

2007-01-09 Thread Gavin Sherry
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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Building libpq/psql with Borland BCC5

2007-01-09 Thread Bruce Momjian
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/msg3.php

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] Building libpq/psql with Borland BCC5

2007-01-09 Thread Bruce Momjian
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/msg3.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   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Building libpq/psql with Borland BCC5

2007-01-09 Thread Tom Lane
Gavin Sherry [EMAIL PROTECTED] 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

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster