Re: [HACKERS] [PATCHES] log_statement output for protocol

2006-08-05 Thread Oliver Jowett
Bruce Momjian wrote: OK, updated patch, with output of text bind parameters. New output is: LOG: prepare sel1: SELECT $1 + $2; LOG: bind sel1: SELECT $1 + $2; LOG: bind sel1: parameter 1: "8" LOG: bind sel1: parameter 2: "5" LOG: execut

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-09-11 Thread Oliver Jowett
Tom Lane wrote: > So the postmaster-log message may be the best we can do ... > but I don't think we should drop the connection. Here's a patch to do that; it appears to work as intended on my Linux system. -O Index: src/backend/libpq/pqcomm.c =

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-09-08 Thread Oliver Jowett
Tom Lane wrote: > I'm not sure if we can issue a notice that will be seen on the client > side at this point in the startup cycle. I seem to recall the protocol > document advising against sending NOTICEs during the authentication > cycle. As currently written the setsockopt() calls are done ver

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-09-08 Thread Oliver Jowett
Tom Lane wrote: > Oliver Jowett <[EMAIL PROTECTED]> writes: > >>The assumption I'm making is that if the TCP_* values are present at >>compile time, then you can make a setsockopt() call and get a sane error >>code back if there's no support -- ra

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-09-08 Thread Oliver Jowett
Tom Lane wrote: > Oliver Jowett <[EMAIL PROTECTED]> writes: > >>Merlin Moncure wrote: >> >>>Even better would be a stronger test to make sure o/s supports this >>>feature. > > >>Well, the code assumes that if the TCP_* constants are pre

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-09-08 Thread Oliver Jowett
Merlin Moncure wrote: >>Here's a patch that adds four new GUCs: >> >> tcp_keepalives (defaults to on, controls SO_KEEPALIVE) >> tcp_keepalives_idle (controls TCP_KEEPIDLE) >> tcp_keepalives_interval (controls TCP_KEEPINTVL) >> tcp_keepalives_count (controls TCP_KEEPCNT) > > > I just tested th

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-07-29 Thread Oliver Jowett
Bruce Momjian wrote: > Is this the functionality we agreed we wanted? I think it covers Tom's comments on the first version: - a GUC to turn off SO_KEEPALIVE isn't particularly useful - don't do redundant get/setsockopt calls on backend startup -O ---(end of broadcast)

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-07-04 Thread Oliver Jowett
Bruce Momjian wrote: > Is this patch being worked on? Here's an updated version. It compiles and appears to work as expected under Linux (supports TCP_KEEPIDLE etc) and Solaris 9 (no support). Main changes: - removed the tcp_keepalives GUC, SO_KEEPALIVE is now always on (as in current CVS) - {ge

Re: [HACKERS] [PATCHES] Implementing RESET CONNECTION ...

2005-06-06 Thread Oliver Jowett
Christopher Kings-Lynne wrote: What would be absolutely ideal is a reset connection command, plus some way of knowing via the protocol if it's needed or not. And a way of notifying the client that a reset has happened. -O ---(end of broadcast)--

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-06-06 Thread Oliver Jowett
Bruce Momjian wrote: Is this patch being worked on? I have shelved it for the moment, waiting on any further comments from Tom before reworking it. -O ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-05-26 Thread Oliver Jowett
Tom Lane wrote: Oliver Jowett <[EMAIL PROTECTED]> writes: Here's a patch that adds four new GUCs: tcp_keepalives (defaults to on, controls SO_KEEPALIVE) tcp_keepalives_idle (controls TCP_KEEPIDLE) tcp_keepalives_interval (controls TCP_KEEPINTVL) tcp_keepalives_coun

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-05-25 Thread Oliver Jowett
Bruce Momjian wrote: > Where are we on this? I do think it solves a problem that some are > having, and it seems it would detect a disconnected client and abort a > long running query. I haven't had a chance to do any work to support the Solaris stuff, but otherwise I'm just waiting on review. N

Re: [PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL

2005-05-04 Thread Oliver Jowett
Oliver Jowett wrote: > Here's a patch that adds four new GUCs: > I haven't had a chance to check it builds on other systems or to test > that this handles actual network failures nicely yet. The patch builds OK on Solaris 9, which doesn't have the required socket opt

[PATCHES] Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL (was Re: [HACKERS] Feature freeze date for 8.1)

2005-05-02 Thread Oliver Jowett
Tom Lane wrote: > Oliver Jowett <[EMAIL PROTECTED]> writes: > >>Tom Lane wrote: >> >>>I'm not convinced that Postgres ought to provide >>>a way to second-guess the TCP stack ... > > >>Would you be ok with a patch that allowed configu

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-04 Thread Oliver Jowett
(cc'ing -hackers) Karel Zak wrote: I think command status is common and nice feedback for client. I think it's more simple change something in JDBC than change protocol that is shared between more tools. There is a bit of a queue of changes that would be nice to have but require a protocol version

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-04 Thread Oliver Jowett
Hans-Jürgen Schönig wrote: If the JDBC driver prefers different behaviour (maybe for prepared statements) we should discuss further options for RESET. Now there is: RESET CONNECTION (cleaning entire connection), RESET ALL (cleaning GUCS only) and RESET some_guc. Maybe we want RESET LISTENER, RESE

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-04 Thread Oliver Jowett
Karel Zak wrote: I still don't see a big difference between DEALLOCATE and RESET -- both can break the JDBC driver. You have to go out of your way to break the driver via DEALLOCATE, explicitly finding a statement name that the driver is using. There's also a reasonably simple fix: make the proto

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-03 Thread Oliver Jowett
Tom Lane wrote: Fair point, but you could make the same argument against *any* side effect of RESET CONNECTION. You're just complaining about PREPARE because you can see immediately where that breaks JDBC. Anything that any driver does to set up per-connection state the way it wants will be equal

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-03 Thread Oliver Jowett
Tom Lane wrote: Kris Jurka <[EMAIL PROTECTED]> writes: Also I don't like the idea of cleaning up prepared statements. Hmm. This seems a bit eye-of-the-beholder-ish, ie you could make a legitimate argument either way. Maybe the RESET CONNECTION command should have an option whether to zap prepare

Re: [PATCHES] Implementing RESET CONNECTION ...

2005-01-03 Thread Oliver Jowett
Resending to the correctly-spelled list alias. Why does postgresql.org not generate bounces for unknown addresses, anyway? Original Message Subject: Re: [PATCHES] Implementing RESET CONNECTION ... Date: Tue, 04 Jan 2005 13:58:44 +1300 From: Oliver Jowett <[EMAIL PROTECTED]&

Re: [PATCHES] [HACKERS] CVS should die

2004-11-04 Thread Oliver Jowett
Tom Lane wrote: AFAICS the only nondestructive way to do this is to cvs delete and cvs add, with a commit comment saying where the files were moved from. Then when you are looking at them in CVS, you'd have to navigate over to the previous location (by hand, probably; the commit comment isn't goin

Re: [PATCHES] cast pid_t to int when using *printf

2004-10-09 Thread Oliver Jowett
Bruce Momjian wrote: I see in include/sys/types.h on Solaris 9: #if defined(_LP64) || defined(_I32LPx) typedef uint_t nlink_t; /* file link type */ typedef int pid_t; /* process id type */ #else typedef ulong_t

Re: [PATCHES] Support LDFLAGS_SL on most ports

2004-10-07 Thread Oliver Jowett
Peter Eisentraut wrote: Two comments: First, support for specifying it on configure requires you to call AC_ARG_VAR ("require" as in it would prevent people from shooting themselves in the foot). Please read up on it and add the appropriate call. Ok, so that makes sure that the var is hooked in

Re: [PATCHES] Support LDFLAGS_SL on most ports

2004-10-05 Thread Oliver Jowett
Oliver Jowett wrote: This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously it was only used on AIX and BeOS), and adds support for specifying it in configure. Any feedback on this patch? Can it get applied for 8.0? -O ---(end of broadcast

Re: [PATCHES] cast pid_t to int when using *printf

2004-09-24 Thread Oliver Jowett
Peter Eisentraut wrote: Am Freitag, 24. September 2004 09:34 schrieb Oliver Jowett: Neil Conway wrote: On Fri, 2004-09-24 at 16:51, Oliver Jowett wrote: gcc (3.2.3 on Solaris 9) warns about a couple of places where a pid_t is formatted with %d by a printf-family function. For curiosity's

Re: [PATCHES] cast pid_t to int when using *printf

2004-09-24 Thread Oliver Jowett
Neil Conway wrote: On Fri, 2004-09-24 at 16:51, Oliver Jowett wrote: gcc (3.2.3 on Solaris 9) warns about a couple of places where a pid_t is formatted with %d by a printf-family function. For curiosity's sake, what formatting escape does gcc prefer? I don't think there is an escape

[PATCHES] cast pid_t to int when using *printf

2004-09-23 Thread Oliver Jowett
gcc (3.2.3 on Solaris 9) warns about a couple of places where a pid_t is formatted with %d by a printf-family function. This patch explicitly casts to int to suppress the warning. -O Index: src/backend/postmaster/pgstat.c === RCS fi

[PATCHES] Support LDFLAGS_SL on most ports

2004-09-23 Thread Oliver Jowett
This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously it was only used on AIX and BeOS), and adds support for specifying it in configure. This lets you do something like: ./configure LDFLAGS=-static-libgcc LDFLAGS_SL=-static-libgcc to produce binaries that do not depend on lib

Re: [PATCHES] SGML cleanup

2004-08-22 Thread Oliver Jowett
Alvaro Herrera wrote: !The SQL2003 standard specifies that the keyword !SAVEPOINT is mandatory. PostgreSQL and !Oracle allow the SAVEPOINT !keyword to be omitted. SQL2003 allows only WORK, not Why are we mentioning Oracle behavior at all? One of the influences on the SAVEPOIN

Re: [PATCHES] Add GUC_REPORT to server_encoding, integer_datetimes

2004-08-17 Thread Oliver Jowett
Bruce Momjian wrote: Is this 8.0 material? Tom's already applied it.. -O ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [PATCHES] [HACKERS] libpq problem

2004-08-17 Thread Oliver Jowett
Bruce Momjian wrote: OK, I like your idea of chaining on to any existing SIGPIPE handler rather than just do it if none is installed. I also see your fix for the uninitialized thread-specific variable. I added some comments to the patch, renamed the pipeheader variable so it was pg_* to avoid name

Re: [PATCHES] Add GUC_REPORT to server_encoding, integer_datetimes

2004-08-12 Thread Oliver Jowett
Oliver Jowett wrote: This adds GUC_REPORT to server_encoding and integer_datetimes so they are reported in the V3 protocol startup packet. s/startup packet/startup process/ -O ---(end of broadcast)--- TIP 6: Have you searched our list archives

[PATCHES] Add GUC_REPORT to server_encoding, integer_datetimes

2004-08-12 Thread Oliver Jowett
This adds GUC_REPORT to server_encoding and integer_datetimes so they are reported in the V3 protocol startup packet. Also some related doc updates. Rationale: 1) server_encoding is useful to allow clients to detect bad server/client encoding pairs. The one that bites JDBC regularly is client_

Re: [PATCHES] [HACKERS] SAVEPOINT syntax again

2004-08-12 Thread Oliver Jowett
Tom Lane wrote: Oliver Jowett <[EMAIL PROTECTED]> writes: ::= RELEASE SAVEPOINT Oracle does not have RELEASE SAVEPOINT. DB2 has RELEASE [ TO ] SAVEPOINT I'd vote for RELEASE [ SAVEPOINT ] (for brevity, and for consistency with ROLLBACK). I feel no urge to copy DB2. Here's

Re: [PATCHES] [HACKERS] SAVEPOINT syntax again

2004-08-11 Thread Oliver Jowett
Making the assumption that we want standards-conforming syntax here, I went ahead and did the necessary changes: Oliver Jowett wrote: Comments: 1) We have a different syntax to the SQL200n draft (and Oracle by the looks of it) for ROLLBACK. The draft says: ::= ROLLBACK [ WORK ] [ AND [ NO

Re: [PATCHES] [HACKERS] UNICODE characters above 0x10000

2004-08-07 Thread Oliver Jowett
Tatsuo Ishii wrote: Tom Lane wrote: If I understood what I was reading, this would take several things: * Remove the "special UTF-8 check" in pg_verifymbstr; * Extend pg_utf2wchar_with_len and pg_utf_mblen to handle the 4-byte case; * Set maxmblen to 4 in the pg_wchar_table[] entry for UTF-8. Are

Re: [PATCHES] [HACKERS] UNICODE characters above 0x10000

2004-08-07 Thread Oliver Jowett
Tom Lane wrote: If I understood what I was reading, this would take several things: * Remove the "special UTF-8 check" in pg_verifymbstr; * Extend pg_utf2wchar_with_len and pg_utf_mblen to handle the 4-byte case; * Set maxmblen to 4 in the pg_wchar_table[] entry for UTF-8. Are there any other place

Re: [PATCHES] [HACKERS] Function to kill backend

2004-07-26 Thread Oliver Jowett
Tom Lane wrote: So what you'd basically need is a separate signal to trigger that sort of exit, which would be easy ... if we had any spare signal numbers. What about multiplexing it onto an existing signal? e.g. set a shared-mem flag saying "exit after cancel" then send SIGINT? I guess this is g

Re: [PATCHES] [HACKERS] Function to kill backend

2004-07-26 Thread Oliver Jowett
Andreas Pflug wrote: Tom Lane wrote: If you don't mind plastering a "use at your own risk" sign on it, then go for it. killing a backend is obviously much more "at your own risk" than a descent function. [...] What about implementing "kill" as "cancel then exit"? Does that guarantee a safe exit

[PATCHES] fix for parameterized queries in DECLARE CURSOR statements

2004-07-26 Thread Oliver Jowett
Here's a patch that allows parameterized queries to be used in a DECLARE CURSOR statement. Previously, the DECLARE would succeed but any FETCHes would fail as the parameter values supplied to DECLARE were not propagated to the portal it created. This patch adds that propagation. See http://arc

Re: [PATCHES] [subxact] Proof-of-concept: report nest level to client

2004-07-16 Thread Oliver Jowett
Tom Lane wrote: Alvaro Herrera <[EMAIL PROTECTED]> writes: Patch attached (surprinsingly small), though it only applies with the savepoint patch applied(*). If any driver writer wants to play, however, it's easy to see what's going on -- a ParameterStatus message will be received from the backend

Re: [PATCHES] Nested transactions

2004-06-18 Thread Oliver Jowett
Barry Lind wrote: The other thing that I have been meaning to say in this thread is that I don't like using COMMIT to mean subtransaction commit (vs. introducing a new command for it) because of the following situation. Lets say that I have a java method that takes a jdbc connection and this c

[PATCHES] delayed planning of unnamed statements

2004-05-24 Thread Oliver Jowett
Per discussion on -hackers (http://archives.postgresql.org/pgsql-hackers/2004-05/msg00990.php), here is a first cut at delaying query planning for unnamed statements until we have concrete parameters (i.e. at Bind). This passes 'make check' (not particularly informative since that doesn't exer