Re: [PATCHES] eventlog fix

2004-06-02 Thread Magnus Hagander
 The purpose of this patch is to fix an error when 
 log_destination is set to 'eventlog' value in postgresql.conf files.

Looks good to me, just a couple of tiny things:

snip

 After discussion on win32 mailing list, I suggest to store 
 source under src/bin/pg_event

I assume you mean src/bin/pgevent, to be consistent with the naming used
inside the program.


Second, I'd register the source as PostgreSQL, not PostGreSQL. I
don't think the captital-G is generally used, and it's specifically
NOT what the backend uses. Sure, the key reading process is
case-insensitive today, but it's still a good idea to keep things
consistent :-)

(Actually, this goes for the error msgs as well)


Finally, I'd also move the GetModuleFilename() call to before
RegCreateKey(). In the (very rare) case that it would fail, you don't
want to alerady have created the registry key.



//Magnus


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


Re: [PATCHES] pg_ctl.c

2004-06-02 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Bruce Momjian wrote:
| Gaetano Mendola wrote:
|
|Bruce Momjian wrote:
|
|
|Here is the C version of pg_ctl.c written by Andrew Dunstan and updated
|by me.
|
|You can use it by creating a src/bin/pg_ctl_test directory and putting
|the C and Makefile into that directory.  You can then do a make install
|and use it for testing.
|
|Unless someone finds a problem, I will apply the change soon.  This
|removes our last shell script!
|
|It desn't compile on my platform:
|
|$ gcc -I /usr/include/pgsql/server pg_ctl.c
|pg_ctl.c: In function `start_postmaster':
|pg_ctl.c:219: error: `DEVNULL' undeclared (first use in this function)
|pg_ctl.c:219: error: (Each undeclared identifier is reported only once
|pg_ctl.c:219: error: for each function it appears in.)
|
|
| DEVNULL is in CVS port.h.  Are you running against CVS?
No. Against 7.4.1
|2) xstrdup protected by duplicate NULL string
|
|
| You mean that you can't pass NULL to xstrdup?  Yea, but if we do, it
| will crash and we will hear about it right away.
Yea u'r right, it will crash without know why, for the same reason you can
avoid to use the xstrdup then.

Regards
Gaetano Mendola

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAtE3h7UpzwH2SGd4RAjDhAKDV8lRn7XEAGqHLBJzQTvrBlyJsXgCgrw5c
CljcRIysGU3+IGoVbHU9vYg=
=9jrs
-END PGP SIGNATURE-
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [PATCHES] [HACKERS] Configuration patch

2004-06-02 Thread Bruce Momjian

Here is an updated version of your patch.  I removed the tablespace part
because we are going to have real tablespaces in 7.5 rather than
initlocation hacks.  I added documention of the new guc parameters, and
a paragraph in the postmaster manual page describing the new -D/PGDATA
behavior.  (Is that enough?)  I see a few malloc/strup's in the
guc-file.l patch, but they seem OK.  I cleaned up the patch to be more
intuitive in its use of variable names and structure.

I will apply it in a day or if I get other feedback.

---

[EMAIL PROTECTED] wrote:
 This patch incorporates a number of changes suggested by the group. The
 purpose of this patch is to move postgresql to a position where all
 configuration options are specified in one place. The postgresql.conf file
 could completely document a postgresql environment.
 
 
 It adds this functionality:
 
 The -D' option will work as it always has if it is set to a standard
 postgresql database cluster directory. If it is set to a postgresql.conf
 file, it will use that file for configuration. If it is set to a directory
 which is not a cluster directory, i.e. /somepath/etc it will look for
 pg_hba.conf, pg_ident.conf, and postgresql.conf there.
 
 For postgresql to work only with a configuration file, some options have
 been added:
 
 include = '/etc/postgres/debug.conf'
 pgdata = '/vol01/postgres'
 hba_conf = '/etc/postgres/pg_hba_conf'
 ident_conf = '/etc/postgres/pg_ident.conf'
 runtime_pidfile = '/var/run/postgresql.conf'
 tablespace = '/somevol/somepath'
 
 include allows files with configuration parameters to be included.
 
 pgdata (used to be data_dir in old patch) tells PostgreSQL where it's
 database cluster directory is located.
 
 hba_conf tells PostgreSQL where to find pg_hba.conf file.
 
 ident_conf tells PostgreSQL where to find pg_ident.conf.
 
 runtime_pidfile tells postgres to write it's PID to a file that would be
 used by external applications. It is *NOT* the pid file which postgresql
 uses.
 
 tablespace allows postgresql to use alternate locations without
 environment variables. Using SIGHUP, tablespaces are reloaded. This allows
 you to add tablespaces to a running PostgreSQL process. (I know this has a
 limited lifetime, but it may make CREATE DATABASE ... WITH LOCATION a
 little bit more sane in the meantime.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/runtime.sgml
===
RCS file: /cvsroot/pgsql-server/doc/src/sgml/runtime.sgml,v
retrieving revision 1.265
diff -c -c -r1.265 runtime.sgml
*** doc/src/sgml/runtime.sgml   26 May 2004 18:51:43 -  1.265
--- doc/src/sgml/runtime.sgml   2 Jun 2004 20:31:36 -
***
*** 563,568 
--- 563,625 
  any desired selection condition.
 /para
  
+sect2 id=runtime-config-configuration-files
+ titleConfiguration Files/title
+ 
+  variablelist
+ 
+  varlistentry id=guc-include xreflabel=include
+   termvarnameinclude/varname (typestring/type)/term
+   listitem
+para
+  Specifies an additional file to read for configuration settings.
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry id=guc-hba-conf xreflabel=hba-conf
+   termvarnamehba_conf/varname (typestring/type)/term
+   listitem
+para
+  Specifies the file name to use for configuration of host-based 
+  authentication (HBA).
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry id=guc-ident-conf xreflabel=ident-conf
+   termvarnameident_conf/varname (typestring/type)/term
+   listitem
+para
+  Specifies the file name to use for configuration of 
+  applicationident/ authentication.
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry id=guc-pgdata xreflabel=pgdata
+   termvarnamepgdata/varname (typestring/type)/term
+   listitem
+para
+  Specifies the directory to use for data storage (everything except
+  configuration files).
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry id=external-pidfile xreflabel=external-pidfile
+   termvarnameexternal_pidfile/varname (typestring/type)/term
+   listitem
+para
+  Specifies the location of an additional applicationpostmaster/
+  process-id (PID) file for use by server administration programs.
+/para
+   /listitem
+  /varlistentry
+ 
+  /variablelist
+/sect2
+ 
 sect2 id=runtime-config-connection
  titleConnections and Authentication/title
  
Index: doc/src/sgml/ref/postmaster.sgml

Re: [PATCHES] Small change in link order

2004-06-02 Thread Bruce Momjian

Patch applied.  Thanks.

---


Magnus Hagander wrote:
 This patch changes the order of libraries on the link command when
 linking things with pgport. This is required for win32 to build when
 modules in libpgport refer to global variables in the backend (right
 now, specifically path.c does this). And I don't see that it should
 cause any problems on other platforms.
 
 //Magnus
 

Content-Description: linkorder.patch

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 6: Have you searched our list archives?
 
http://archives.postgresql.org

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] Cancel/Kill backend functions

2004-06-02 Thread Bruce Momjian

Patch applied.  Thanks.

Not sure where to document them.  I think we talked about this already.

I updated the system catalog version.

---


Magnus Hagander wrote:
 Arrgh, when will I ever learn :-(
 
 Attached.
 
 //Magnus
 
 
 -Original Message-
 From: Bruce Momjian [mailto:[EMAIL PROTECTED] 
 Sent: den 26 maj 2004 20:50
 To: Magnus Hagander
 Cc: Neil Conway; [EMAIL PROTECTED]
 Subject: Re: [PATCHES] Cancel/Kill backend functions
 
 
 
 Magnus, would you please resumbit this as a context diff?
 
 ---
 
 
 Magnus Hagander wrote:
  Okay, here is an updated patch. now uses IsBackendPid(), which is 
  closely modeled (read cut-and-pasted) from 
  TransactionIdIsInProgress().
  
  Since it's no longer a pgstat function, I moved it to misc.c. Not 
  100% that's the right place either, but it seemed like the best 
  alternative.
  
  //Magnus
  
  
  -Original Message-
  From: Neil Conway [mailto:[EMAIL PROTECTED]
  Sent: den 22 maj 2004 10:00
  To: Magnus Hagander
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PATCHES] Cancel/Kill backend functions
  
  
  Magnus Hagander wrote:
   Per previous discussions, here are two functions to send INT and 
   TERM signals to other backends.They permit only INT and TERM, and 
   permits sending only to postgresql backends (as registered in 
   pgstat).
  
  Why does this depend on pgstat? ISTM it would be better to use the
  per-backend PGPROC information, which is stored in shared memory. 
  Consider TransactionIdIsInProgress() for an example.
  
  -Neil
  
 
 Content-Description: termbackend.patch
 
 [ Attachment, skipping... ]
 
  
  ---(end of 
  broadcast)---
  TIP 7: don't forget to increase your free space map settings
 
 -- 
   Bruce Momjian|  http://candle.pha.pa.us
   [EMAIL PROTECTED]   |  (610) 359-1001
   +  If your life is a hard drive, |  13 Roberts Road
   +  Christ can be your backup.|  Newtown Square, 
 Pennsylvania 19073
 

Content-Description: termbackend2.patch

[ Attachment, skipping... ]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] Small doc patch for area() function...

2004-06-02 Thread Bruce Momjian

Doc patch applied.  The geometry diff you attached is related to
negative zeros.  I think you will find geometry_1.out will be a better
match for you. I thought our code now automatically picked the proper
geometry file.  However, I can't find out how that file is used.

---

Sean Chittenden wrote:
 Small patch that adds some documentation for the area() function.   
 Specifically, point out that intersecting points in a path will yield  
 (most likely), unexpected results.  Visually these are identical paths,  
 but mathematically they're not the same.  Ex:
 
   area |   plan
 -- 
 +--- 
 ---
 -0 | ((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))
  2 | ((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))
 
 The current algorithm for area(PATH) is very quick, but only handles  
 non-intersecting paths.  I'm going to work on two other functions for  
 the PATH data type that determines if a PATH is intersecting or not,  
 and a function that returns the area() for an intersecting PATH.  The  
 intersecting area() function will be considerably slower (I think it's  
 going to be O(n!) or worse instead of the current O(n), but that comes  
 with the territory).
 
 -sc
 

[ Attachment, skipping... ]

 
 
 
 PS  Right now I'm developing on OS-X and there's a geometry regression 
 test that's returning -0.  FWIW
 
 *** ./expected/geometry.out Fri Oct 31 19:07:07 2003
 --- ./results/geometry.out  Thu May 27 22:16:58 2004
 ***
 *** 117,123 
| (5.1,34.5) | [(1,2),(3,4)] | (3,4)
| (-5,-12)   | [(1,2),(3,4)] | (1,2)
| (10,10)| [(1,2),(3,4)] | (3,4)
 ! | (0,0)  | [(0,0),(6,6)] | (-0,0)
| (-10,0)| [(0,0),(6,6)] | (0,0)
| (-3,4) | [(0,0),(6,6)] | (0.5,0.5)
| (5.1,34.5) | [(0,0),(6,6)] | (6,6)
 --- 117,123 
| (5.1,34.5) | [(1,2),(3,4)] | (3,4)
| (-5,-12)   | [(1,2),(3,4)] | (1,2)
| (10,10)| [(1,2),(3,4)] | (3,4)
 ! | (0,0)  | [(0,0),(6,6)] | (0,0)
| (-10,0)| [(0,0),(6,6)] | (0,0)
| (-3,4) | [(0,0),(6,6)] | (0.5,0.5)
| (5.1,34.5) | [(0,0),(6,6)] | (6,6)
 
 ==
 
 
 
 -- 
 Sean Chittenden

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

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] eventlog fix

2004-06-02 Thread Laurent Ballester
Hello magnus,

 I assume you mean src/bin/pgevent, to be consistent with the naming used
 inside the program.

OK, I Modify Makefile subdir value. In fact I name it pg_event because many
directory under src/bin began with pg_ .

 Second, I'd register the source as PostgreSQL, not PostGreSQL. I
 don't think the captital-G is generally used, and it's specifically
 NOT what the backend uses. Sure, the key reading process is
 case-insensitive today, but it's still a good idea to keep things
 consistent :-)

I modify pgevent.c, for your both remarks: capital G are disappears from
source and I move GetModuleFilename() before RegCreateKey() call.

I sent full set file again, it will be easier to apply.

regards,

Laurent
LANGUAGE 0x9,0x1
1 11 MSG1.bin


Makefile
Description: Binary data


MSG1.bin
Description: Binary data
/*-
 *
 * pgevent.c
 *  Defines the entry point for pgevent dll.
 *  The DLL defines event source for backend
 *
 *
 * IDENTIFICATION
 *$PostgreSQL$
 *
 *-
 */


#include windows.h
#include olectl.h
#include string.h

/* Global variables */
HANDLE g_hModule = NULL;/* hModule of DLL */

/* Prototypes */
STDAPI DllRegisterServer(void) ;
STDAPI DllUnregisterServer(void);
BOOL WINAPI DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved );

/*
 * DllRegisterServer --- Instructs DLL to create its registry entries 
 */

STDAPI DllRegisterServer(void) 
{
HKEY hk; 
DWORD dwData; 
char szBuffer[_MAX_PATH]; 

/* Set the name of DLL full path name. */
if (!GetModuleFileName((HMODULE)g_hModule, szBuffer, sizeof(szBuffer)))
{
MessageBox(NULL, Could not retrieve DLL filename, PostgreSQL 
error, MB_OK|MB_ICONSTOP); 
return SELFREG_E_TYPELIB; 
}

/* Add PostgreSQL source name as a subkey under the Application 
   key in the EventLog registry key. */
if ( RegCreateKey(HKEY_LOCAL_MACHINE, 
SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\PostgreSQL, hk) ) 
{
MessageBox(NULL, Could not create the registry key., PostgreSQL error, 
MB_OK|MB_ICONSTOP); 
return SELFREG_E_TYPELIB; 
}

 /* Add the name to the EventMessageFile subkey. */
if (RegSetValueEx(hk,   
EventMessageFile, 
0,  
REG_EXPAND_SZ,
(LPBYTE) szBuffer,
strlen(szBuffer) + 1))
{
MessageBox(NULL, Could not set the event message file., PostgreSQL error, 
MB_OK|MB_ICONSTOP); 
return SELFREG_E_TYPELIB; 
}
 
/* Set the supported event types in the TypesSupported subkey. */
dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; 
 
if (RegSetValueEx(hk,  
TypesSupported,  
0, 
REG_DWORD, 
(LPBYTE) dwData,  
sizeof(DWORD)))
{
MessageBox(NULL, Could not set the supported types., PostgreSQL error, 
MB_OK|MB_ICONSTOP); 
return SELFREG_E_TYPELIB; 
}
 
RegCloseKey(hk); 
return S_OK;
}

/*
 * DllUnregisterServer --- Instructs DLL to remove only those entries created through 
DllRegisterServer
 */

STDAPI DllUnregisterServer(void)
{
/* Remove PostgreSQL source name as a subkey under the Application 
   key in the EventLog registry key. */
 
if ( RegDeleteKey(HKEY_LOCAL_MACHINE, 
SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\PostgreSQL) )
{
MessageBox(NULL, Could not delete the registry key., PostgreSQL 
error, MB_OK|MB_ICONSTOP); 
return SELFREG_E_TYPELIB; 
}
return S_OK;
}

/*
 * DllMain --- is an optional entry point into a DLL.
 */

BOOL WINAPI DllMain( HANDLE hModule, 
 DWORD  ul_reason_for_call, 
 LPVOID lpReserved
)
{
if ( ul_reason_for_call == DLL_PROCESS_ATTACH ) 
{
g_hModule = hModule;
}
return TRUE;
}

; dlltool --output-def pgevent.def pgevent.o pgmsgevent.o
EXPORTS
[EMAIL PROTECTED] @ 1; 
[EMAIL PROTECTED] @ 2; 
//
//  Values are 32 bit values layed out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-+---+---+
//  |Sev|C|R| Facility  |   Code|
//  +---+-+-+---+---+
//
//  where
//
//  

Re: [PATCHES] Relocatable locale

2004-06-02 Thread Bruce Momjian

With no one coming up with a better idea, this applied patch adds PGETC
(for pg_service.conf) and PGLOCALE (for locale dir) environment variable
processing to libpq.

The patch also adds code to our client apps so we set the environment
variable directly based on our binary location, unless it is already
set. This will allow our applications to emit proper locale messages
that are generated in libpq.

---

Bruce Momjian wrote:
 Andrew Dunstan wrote:
  
  
  Bruce Momjian wrote:
  
  Peter Eisentraut wrote:

  
  Andrew Dunstan wrote:
  
  
  I'm confused. Can you explain the problem more clearly, please? Do we
  need to distinguish known apps with a known (relative) message
  location, from unknown libpq clients?

  
  The problem boils down to the fact that libpq needs to find its data 
  files (in this case locale data, but it could be anything), but it 
  doesn't know its own location, so it can't use a relative path 
  reference as has been proposed.
  
  
  
  I am wondering if we should use environment variables, and have our apps
  use putenv() to set it to the proper relative path.

  
  
  It seems a bit roundabout, but might make sense. Maybe they shouldn't 
  override any value already present in the environment, just set it if 
  there is nothing there? Then the library could use the environment if 
  set, or fall back on a hardcoded path.
 
 Yes, that is what I was thinking.  Call it PGLOCALEDIR.
 
 -- 
   Bruce Momjian|  http://candle.pha.pa.us
   [EMAIL PROTECTED]   |  (610) 359-1001
   +  If your life is a hard drive, |  13 Roberts Road
   +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
 
 ---(end of broadcast)---
 TIP 8: explain analyze is your friend
 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/libpq.sgml
===
RCS file: /cvsroot/pgsql-server/doc/src/sgml/libpq.sgml,v
retrieving revision 1.155
diff -c -c -r1.155 libpq.sgml
*** doc/src/sgml/libpq.sgml 14 May 2004 18:04:02 -  1.155
--- doc/src/sgml/libpq.sgml 2 Jun 2004 23:59:33 -
***
*** 3582,3587 
--- 3582,3605 
  (Equivalent to literalSET geqo TO .../literal.)
  /para
  /listitem
+ listitem
+ para
+ indexterm
+  primaryenvarPGETC/envar/primary
+ /indexterm
+ envarPGETC/envar
+ sets the directory containing the filenamepg_service.conf/ file.
+ /para
+ /listitem
+ listitem
+ para
+ indexterm
+  primaryenvarPGLOCALE/envar/primary
+ /indexterm
+ envarPGLOCALE/envar
+ sets the directory containing the literallocale/ files.
+ /para
+ /listitem
  /itemizedlist
  
  Refer to the acronymSQL/acronym command commandSET/command
Index: src/backend/main/main.c
===
RCS file: /cvsroot/pgsql-server/src/backend/main/main.c,v
retrieving revision 1.85
diff -c -c -r1.85 main.c
*** src/backend/main/main.c 29 May 2004 22:48:19 -  1.85
--- src/backend/main/main.c 2 Jun 2004 23:59:41 -
***
*** 152,158 
 * allow startup error messages to be localized.
 */
  
!   set_pglocale(argv[0], postgres);
  
  #ifdef WIN32
  
--- 152,158 
 * allow startup error messages to be localized.
 */
  
!   set_pglocale_pgservice(argv[0], postgres);
  
  #ifdef WIN32
  
Index: src/bin/initdb/initdb.c
===
RCS file: /cvsroot/pgsql-server/src/bin/initdb/initdb.c,v
retrieving revision 1.34
diff -c -c -r1.34 initdb.c
*** src/bin/initdb/initdb.c 1 Jun 2004 02:53:59 -   1.34
--- src/bin/initdb/initdb.c 2 Jun 2004 23:59:53 -
***
*** 1788,1794 
{global, pg_xlog, pg_clog, base, base/1};
  
progname = get_progname(argv[0]);
!   set_pglocale(argv[0], initdb);
  
  if (argc  1)
  {
--- 1788,1794 
{global, pg_xlog, pg_clog, base, base/1};
  
progname = get_progname(argv[0]);
!   set_pglocale_pgservice(argv[0], initdb);
  
  if (argc  1)
  {
Index: src/bin/pg_controldata/pg_controldata.c
===
RCS file: /cvsroot/pgsql-server/src/bin/pg_controldata/pg_controldata.c,v
retrieving revision 1.16
diff -c -c -r1.16 pg_controldata.c
*** src/bin/pg_controldata/pg_controldata.c 25 May 2004 01:00:23 -  1.16
--- src/bin/pg_controldata/pg_controldata.c 2 Jun 2004 23:59:53 -
***
*** 77,83 
char   *strftime_fmt = %c;
const char *progname;
  
!   

Re: [PATCHES] Compiling libpq with VisualC

2004-06-02 Thread Bruce Momjian
Bruce Momjian wrote:
 
 I noticed that SYSCONFDIR will also be an issue for relocatable installs
 just like localedir.  I will address them in the same way either as an
 environment variable or libpq function call to set the location.

Fixed.

  
  fe-connect.c:
  - pg_config_paths.h isn't available. SYSCONFDIR is already defined so 
  fe-connect.c doesn't need to include that.
  patch appended

This shouldn't be needed anymore.  Where is SYSCONFDIR coming from?  Is
it from some Win32 include file?  It should only be coming from
pg_config_paths.h now.

  win32.mak:
  - pg_config.h must be generated
  - port/pgstrcasecmp.c is needed
  - port/path.c is not needed
  - the current cvs version includes some bogus cr characters, when 
  checking out with wincvs the file will contain several cr cr lf lines 
  which will confuse nmake.
  
  Because the last problem might be difficult to handle as diff, I 
  attached win32.mak as complete file, with all cr stripped so it may be 
  committed safely with any cvs client.

Added.  Thanks.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] Libpq ssl fix

2004-06-02 Thread Bruce Momjian

Patch applied.  Thanks.

---


Andreas Pflug wrote:
 init_ssl_system  will return 0 on success and -1 on failure, which will 
 be interpreted just the other way round in initialize_SSL.
 Patch appended.
 
 Regards,
 Andreas
 

 Index: fe-secure.c
 ===
 RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/fe-secure.c,v
 retrieving revision 1.40
 diff -u -r1.40 fe-secure.c
 --- fe-secure.c   7 May 2004 00:24:59 -   1.40
 +++ fe-secure.c   28 May 2004 14:00:40 -
 @@ -922,7 +922,7 @@
   charfnbuf[2048];
  #endif
  
 - if(!init_ssl_system(conn))
 + if(init_ssl_system(conn))
   return -1;
  
  #ifndef WIN32

 
 ---(end of broadcast)---
 TIP 3: 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

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] fix for pg_regress.sh on mingw

2004-06-02 Thread Bruce Momjian

Patch applied.  Thanks.

---


Andrew Dunstan wrote:
 
 With the attached patch make check runs cleanly for me under MSys/Mingw.
 
 Description of changes:
 
 . only use the -W flag on pwd for $pkglibdir. All the other paths need 
 to be seen as MSys type paths, whereas $pkglibdir needs to be expressed 
 as a genuine windows path.
 . run single tests in the background and explicitly wait for them - 
 solves the problem of the MSys shell not waiting properly for the copy 
 test to finish.
 . use pg_ctl to shut down the test postmaster - no more use of ad hoc 
 kill programs or the task manager.
 
 With these changes there should no longer be any need to run regression 
 tests from cygwin for native Windows builds - you can simply run make 
 check from the build directory in the build environment.
 
 cheers
 
 andrew
 

 Index: src/test/regress/pg_regress.sh
 ===
 RCS file: /projects/cvsroot/pgsql-server/src/test/regress/pg_regress.sh,v
 retrieving revision 1.44
 diff -c -w -r1.44 pg_regress.sh
 *** src/test/regress/pg_regress.sh20 May 2004 00:21:36 -  1.44
 --- src/test/regress/pg_regress.sh28 May 2004 20:06:01 -
 ***
 *** 208,225 
   
   
   # --
 - # Set up pwd to give a win32 happy pathname
 - # --
 - 
 - case $host_platform in
 - *-*-mingw32*)
 - PWDFLAGS=-W;;
 - *)
 - PWDFLAGS=;;
 - esac
 - 
 - 
 - # --
   # Set backend timezone and datestyle explicitly
   #
   # To pass the horology test in its current form, the postmaster must be
 --- 208,213 
 ***
 *** 306,317 
   if [ x$temp_install != x ]
   then
   if echo x$temp_install | grep -v '^x/' /dev/null 21; then
 ! temp_install=`pwd $PWDFLAGS`/$temp_install
   fi
   
   bindir=$temp_install/install/$bindir
   libdir=$temp_install/install/$libdir
 - pkglibdir=$temp_install/install/$pkglibdir
   datadir=$temp_install/install/$datadir
   PGDATA=$temp_install/data
   
 --- 294,313 
   if [ x$temp_install != x ]
   then
   if echo x$temp_install | grep -v '^x/' /dev/null 21; then
 ! case $host_platform in
 !   *-*-mingw32*)
 ! pkglibdir=`pwd -W`/$temp_install/install/$pkglibdir
 !   temp_install=`pwd`/$temp_install
 ! ;;
 !   *)
 ! temp_install=`pwd`/$temp_install
 ! pkglibdir=$temp_install/install/$pkglibdir
 ! ;;
 ! esac
   fi
   
   bindir=$temp_install/install/$bindir
   libdir=$temp_install/install/$libdir
   datadir=$temp_install/install/$datadir
   PGDATA=$temp_install/data
   
 ***
 *** 602,608 
   # Run a single test
   formatted=`echo $1 | awk '{printf %-20.20s, $1;}'`
   $ECHO_N test $formatted ... $ECHO_C
 ! $PSQL -d $dbname $inputdir/sql/$1.sql $outputdir/results/$1.out 
 21
   else
   # Start a parallel group
   $ECHO_N parallel group ($# tests): $ECHO_C
 --- 598,605 
   # Run a single test
   formatted=`echo $1 | awk '{printf %-20.20s, $1;}'`
   $ECHO_N test $formatted ... $ECHO_C
 ! ( $PSQL -d $dbname $inputdir/sql/$1.sql $outputdir/results/$1.out 
 21 )
 ! wait
   else
   # Start a parallel group
   $ECHO_N parallel group ($# tests): $ECHO_C
 ***
 *** 704,710 
   
   if [ -n $postmaster_pid ]; then
   message shutting down postmaster
 ! kill -15 $postmaster_pid
   wait $postmaster_pid
   unset postmaster_pid
   fi
 --- 701,707 
   
   if [ -n $postmaster_pid ]; then
   message shutting down postmaster
 ! $bindir/pg_ctl -s -D $PGDATA stop
   wait $postmaster_pid
   unset postmaster_pid
   fi

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

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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