[PATCHES] pgstat EXEC_BACKEND

2004-03-08 Thread Claudio Natoli

For application to HEAD, following community review.

Corrects a typo, introduces missing variables, and rearranges the
initialization of stats process under EXEC_BACKEND. 

[A cleaner, rationalized approach to stat/backend/SSDataBase child processes
under EXEC_BACKEND is on my TODO list. However this patch takes care of
immediate concerns (ie. stats test now passes under win32)]

--- 
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see 
http://www.memetrics.com/emailpolicy.html";>http://www.memetrics.com/em
ailpolicy.html
  



pgstat.patch
Description: Binary data

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


Re: [PATCHES] contrib/xml2 function name change and minor bitrot

2004-03-08 Thread John Gray
On Sun, 2004-03-07 at 17:54 -0500, Tom Lane wrote:
> Neil Conway <[EMAIL PROTECTED]> writes:
> > A few comments on the module:
> 
> > - can you include some licensing information? "Distributed under the 
> > same terms as PostgreSQL, Copyright ..." should be sufficient unless 
> > you'd prefer another license
> 
> Actually, it had better be "same terms"; we are going to start being
> picky about that for contrib modules.  (I have a TODO I've been ignoring
> to try to bring the existing contrib modules into line.)
> 

Both modules are intended to be on the same terms as PostgreSQL. I can
submit a patch to the README files to make that clear. Question: should
the copyright be in the name of PGDG or me? (I cannot envisage doing
anything with the module that the PostgreSQL licence would prevent, so I
don't think I need to maintain copyright ownership of it)

> > - the readme for both 'contrib/xml' and 'contrib/xml2' is called 
> > 'README.pgxml', yet neither module is actually named 'pgxml'
> 

Oops - I didn't catch that in testing because it's not needed for the
module to work I am loathe to change the installed .so name
(pgxml_dom) for the old module (it might be in people's dump files, I
suppose) so I suggest that renaming the xml/README to README.pgxml_dom
will at least associate the README with the library and sql files. There
are no other files that conflict (the so and sql files have different
names).

The new one is called pgxml (it produces pgxml.so and pgxml.sql) but if
we want to be consistent, perhaps it should be xml2 instead? I'm really
not hung up on the name -it's only a Makefile setting.

In response to Neil's earlier point about configuration of include and
library paths - that's on my personal TODO for the module. The relevant
flags can be retrieved using xml2-config --cflags and xml2-config --libs
(assuming a sane install of libxml2), but I haven't worked out how to
cleanly set these in a module Makefile. I'll have another look at it.

Regards

John



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] Update tests & memory leak fix

2004-03-08 Thread Bruce Momjian

Got the diff -c now, thanks.

---

Lee Kindness wrote:
> Sorry guys, last diff wasn't a context one! "diff -c" attached this time
> round...
> 
> L.
> 
> - Original Message -
> From: Lee Kindness
> To: [EMAIL PROTECTED]
> Cc: Bruce Momjian ; Lee Kindness ; Shridhar Daithankar
> Sent: Saturday, March 06, 2004 3:07 PM
> Subject: ECPG: Update tests & memory leak fix
> 
> See attached diff which corrects a per-thread memory leak in libecpg and
> changes the thread test program to create a user defined number of threads.
> Also attached tar.gz adds an additional thread test, which currently does
> NOT work as expected and is one of the cases Shridar and I will be looking
> at (removing need for AT xxx on every EXEC SQL).
> 
> Note, the updated test shows that ECPG currently DOES support the
> specification of connection names by host variables (not only static strings
> as I had said previously).
> 
> Thanks, L.

[ Attachment, skipping... ]

> 
> ---(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 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] ECPG: Update tests & memory leak fix

2004-03-08 Thread Bruce Momjian

I need a context diff, diff -c.

---

Lee Kindness wrote:
> See attached diff which corrects a per-thread memory leak in libecpg and changes the 
> thread test program to create a user defined number of threads. Also attached tar.gz 
> adds an additional thread test, which currently does NOT work as expected and is one 
> of the cases Shridar and I will be looking at (removing need for AT xxx on every 
> EXEC SQL).
> 
> Note, the updated test shows that ECPG currently DOES support the specification of 
> connection names by host variables (not only static strings as I had said 
> previously).
> 
> Thanks, L.

[ Attachment, skipping... ]

[ 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 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] contrib/xml2 function name change and minor bitrot fix

2004-03-08 Thread Bruce Momjian

Patch applied by Neil (thanks).  Thanks.

---


John Gray wrote:
> Hi,
> 
> I've done a bit of testing now and it seems that both sets of XML
> functions will coexist in the same database (they both load OK and I can
> use functions from both without any apparent problem).
> 
> I have changed the name of the new parse function to xml_valid and fixed
> a reference to SortMem which meant that the code as supplied would work
> against 7.3 and 7.4 but wouldn't work in CVS. Oops! Patch is attached.
> 
> Regards
> 
> John
> 
> 

[ 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

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


Re: [PATCHES] Alter table patch

2004-03-08 Thread Tom Lane
Rod Taylor <[EMAIL PROTECTED]> writes:
> This patch seems to have fallen off of Bruces "To be applied" list
> without being applied. Could I get a status report?

> http://archives.postgresql.org/pgsql-patches/2003-11/msg00222.php

That was the one that did a wholesale revision of the ALTER TABLE
implementation, right?  I have it on my "to do" list, and must
apologize for the delay in reviewing it.

regards, tom lane

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

   http://archives.postgresql.org


Re: [PATCHES] Alter table patch

2004-03-08 Thread Bruce Momjian
Rod Taylor wrote:
> On Mon, 2004-03-08 at 13:41, Tom Lane wrote:
> > Rod Taylor <[EMAIL PROTECTED]> writes:
> > > This patch seems to have fallen off of Bruces "To be applied" list
> > > without being applied. Could I get a status report?
> > 
> > > http://archives.postgresql.org/pgsql-patches/2003-11/msg00222.php
> > 
> > That was the one that did a wholesale revision of the ALTER TABLE
> > implementation, right?  I have it on my "to do" list, and must
> > apologize for the delay in reviewing it.
> 
> Yes it is. I wanted to make sure it was on someones todo list and didn't
> get lost in the shuffle.

I basically pulled it back into my mailbox because it hasn't been
reviewed yet.

-- 
  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


[PATCHES] libpq v2 protocol error: COPY FROM STDIN, PQputCopyEnd()

2004-03-08 Thread ljb

This fixes a protocol violation and disconnect when 7.4.x libpq is talking
to a v2 protocol (<=7.3.x) server. The client does COPY FROM STDIN, uses
the new call PQputCopyData(), then ends the copy using PQputCopyEnd(),
and gets back the odd message:
   FATAL:  Socket command type
followed by "server closed the connection unexpectedly..."

(This won't be seen with psql because it uses the older PQputline() and
PQendcopy() functions. But it breaks COPY into a 7.3 server with my new
Tcl interface pgtcl-ng.)

The problem is that PQputCopyEnd() in libpq sends the copy terminator "\\.\n"
with a trailing null byte. The 7.3.x server does not want the trailing
null there, so it takes it for a command byte. The actual error is
"Socket command type %c unknown" but the %c is '\0' so you lose the rest.

Here's a 1-line patch against 7.4.1 which has PQputCopyEnd() send the
terminator "\\.\n" without a trailing null. (Sorry I missed 7.4.2, but I
just found this.) It will also apply OK (with offset) to what I think will
be 7.4.2 (in CVS as fe-exec.c,v 1.153.2.3). Note this only affects the
down-level "v2" protocol code in libpq.


*** src/interfaces/libpq/fe-exec.c~ Sun Nov 30 15:53:43 2003
--- src/interfaces/libpq/fe-exec.c  Mon Mar  8 19:16:37 2004
***
*** 1447,1453 
{
/* Send old-style end-of-data marker */
if (pqPutMsgStart(0, false, conn) < 0 ||
!   pqPuts("\\.\n", conn) < 0 ||
pqPutMsgEnd(conn) < 0)
return -1;
}
--- 1447,1453 
{
/* Send old-style end-of-data marker */
if (pqPutMsgStart(0, false, conn) < 0 ||
!   pqPutnchar("\\.\n", 3, conn) < 0 ||
pqPutMsgEnd(conn) < 0)
return -1;
}

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


Re: [PATCHES] log_line_info

2004-03-08 Thread Bruce Momjian
Andrew Dunstan wrote:
> 
> I think this is now ready for application, unless someone objects.
> 
> Since the last patch I posted, I have done the following:
> 
> . changed the escapes to lower case, as Peter prefers. This is also in 
> line with what Apache does, which is the nearest equivalent I can think of.
> . added 2 new escapes: %r = remote host and port and %x says "postmaster 
> and friends stop here".  Postmaster and friends will also ignore any 
> escapes they see that don't make sense (specifically %u %d %i %r %s and 
> %c). However, they no longer ignore the whole facility. This means we 
> can use it for logging (for example) timestamps and pids in all cases.
> . added docco
> . changed source port reporting from host:port to host(port) to avoid 
> IP6 address ambiguity.
> 
> If someone wants to monkey with the name of the facility, it shouldn't 
> be hard. I don't like plain "log_line", though. "log_line_prefix" or 
> "log_line_tag" both seem to me better alternatives.
> 
> After this is applied (fingers crossed) and everyone is happy, I will 
> submit a patch to remove log_timestamp, log_pid and (if we are agreed on 
> it) log_source_port.

I have applied this patch.  It will be a great addition to PostgreSQL.

I made a few modifications.  I reordered the options in the docs and
postgresql.conf, e.g.:

+ #log_line_prefix = '' # e.g. '<%u%%%d> '
+   # %u=user name %d=database name
+   # %r=remote host and port
+   # %p=PID %t=timestamp %i=command tag
+   # %c=session id %l=session line number
+   # %s=session start timestamp
+   # %x=stop here in non-session processes
+   # %%='%'

I also changed:

*** src/include/miscadmin.h 10 Feb 2004 03:42:45 -  1.153
--- src/include/miscadmin.h 29 Feb 2004 17:49:07 -
***
*** 24,29 
--- 24,31 
  #define MISCADMIN_H


+ #include "libpq/libpq-be.h"

(wouldn't compile) to:

*** src/backend/utils/misc/ps_status.c  22 Feb 2004 21:26:55 - 
1.17
--- src/backend/utils/misc/ps_status.c  9 Mar 2004 04:33:35 -
***
*** 26,31 
--- 26,32 
  #include 
  #endif

+ #include "libpq/libpq.h"
  #include "miscadmin.h"
  #include "utils/ps_status.h"

for use of "Port".

-- 
  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.245
diff -c -c -r1.245 runtime.sgml
*** doc/src/sgml/runtime.sgml   7 Mar 2004 01:02:55 -   1.245
--- doc/src/sgml/runtime.sgml   9 Mar 2004 04:33:24 -
***
*** 1973,1978 
--- 1973,2070 
   
   
   
+   log_line_prefix (string)
+   
+
+This is a printf-style string that is output at the
+beginning of each log line. The default is an empty string.
+Each recognized escape is replaced as outlined 
+below - anything else that looks like an escape is ignored. Other
+characters are copied straight to the log line. Some escapes are
+only recognised by session processes, and do not apply to
+processes without controlling sessions. Syslog produces its 
own
+timestamp and process ID information, so you probably do not want to
+use those escapes if you are using syslog.
+
+ 
+  
+   
+Escape
+Effect
+Session only
+
+   
+  
+   
+%u
+User Name
+Yes
+   
+   
+%d
+Database Name
+Yes
+   
+   
+%r
+Remote Hostname or IP address, and Remote Port
+Yes
+   
+   
+%p
+Process ID
+No
+   
+   
+%t
+Timestamp
+No
+   
+   
+%i
+Command Tag. This is the command which generated the log
+ line.
+Yes
+   
+   
+%c
+Session ID. A unique identifier for each session.
+It is 2 4-byte hexadecimal numbers separated by a dot. The numbers
+are the Session Start Time and the Process ID,

Re: [PATCHES] log_line_info

2004-03-08 Thread Bruce Momjian

Oh, I also renamed it to "log_line_prefix", which was one of your
suggestions.  And I also updated some of the documentation phrasing.

I also marked the TODO item as completed.

Thanks.

---

Andrew Dunstan wrote:
> 
> I think this is now ready for application, unless someone objects.
> 
> Since the last patch I posted, I have done the following:
> 
> . changed the escapes to lower case, as Peter prefers. This is also in 
> line with what Apache does, which is the nearest equivalent I can think of.
> . added 2 new escapes: %r = remote host and port and %x says "postmaster 
> and friends stop here".  Postmaster and friends will also ignore any 
> escapes they see that don't make sense (specifically %u %d %i %r %s and 
> %c). However, they no longer ignore the whole facility. This means we 
> can use it for logging (for example) timestamps and pids in all cases.
> . added docco
> . changed source port reporting from host:port to host(port) to avoid 
> IP6 address ambiguity.
> 
> If someone wants to monkey with the name of the facility, it shouldn't 
> be hard. I don't like plain "log_line", though. "log_line_prefix" or 
> "log_line_tag" both seem to me better alternatives.
> 
> After this is applied (fingers crossed) and everyone is happy, I will 
> submit a patch to remove log_timestamp, log_pid and (if we are agreed on 
> it) log_source_port.

-- 
  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 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] canonicalize_path: initdb.c -> port/path.c

2004-03-08 Thread Bruce Momjian

Patch applied.  Thanks.

---


Claudio Natoli wrote:
> 
> For application to HEAD.
> 
> The win32 port backend will require the functionality provided by
> canonicalize_path. Patch moves it from initdb.c to port/path.c.
> 
> --- 
> Certain disclaimers and policies apply to all email sent from Memetrics.
> For the full text of these disclaimers and policies see 
>  href="http://www.memetrics.com/emailpolicy.html";>http://www.memetrics.com/em
> ailpolicy.html
>   
> 

[ Attachment, skipping... ]

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

-- 
  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] PostgreSQL: libpq, win32 build

2004-03-08 Thread Bruce Momjian

This builds a debug version of the DLL's along with the non-debug
version.  Patch applied.  Thanks.


---

David Turner wrote:
> Hi
> 
> > > release build uses the cl flags "/MD /D NDEBUG".  Usually the debug
> > > build has a "D" suffix on the file name, so for example:
> > > 
> > > libpqd.dll libpq, debug build
> > > libpqd.lib libpq, debug build, import library
> > > libpq.dll  libpq, release build
> > > libpq.lib  libpq, release build, import library
> > > 
> > 
> > What do we do now?  Build just one file, a lib?
> 
> 
> Currently, src/interfaces/libpq/win32.mak builds a statically-linked
> library "libpq.lib", a debug dll "libpq.dll", import library for the
> debug dll "libpqdll.lib", a release dll "libpq.dll", import library for
> the release dll "libpqdll.lib".  To avoid naming clashes, I would make
> the debug dll and import libraries "libpqd.dll" and "libpqddll.lib".
> 
> Attached is src/interfaces/libpq/win32.mak, modified as I described.  I
> also had to make a copy of libpqdll.def to change the LIBRARY directive.
> 
> 
> Regards
> David Turner

Content-Description: libpqddll.def

[ Attachment, skipping... ]

Content-Description: win32.mak

[ 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 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


Re: [PATCHES] "ALSO" keyword to "CREATE RULE" patch

2004-03-08 Thread Bruce Momjian

Patch applied.  Thanks.

---


Fabien COELHO wrote:
> 
> > Shoot me the patch again and I will put in the the queue.  Thanks.
> 
> Please find attached (again) the patch I sent. It is against 7.4.1.
> If necessary, I can redo the job against current head.
> 
> Have a nice day,
> 
> -- 
> Fabien Coelho - [EMAIL PROTECTED]

Content-Description: 

[ Attachment, skipping... ]

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

-- 
  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 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]