Re: [HACKERS] Proposed GUC Variable

2002-09-01 Thread Bruce Momjian
OK, attached patch applied. I made a few changes. I added a mention they may want to enable LOG_PID because there is no guarantee that the statement and error will appear next to each other in the log file. I also renamed 'query' to 'statement' to be more precise. Also, is there any way to di

Re: [HACKERS] Proposed GUC Variable

2002-08-31 Thread Gavin Sherry
On Thu, 29 Aug 2002, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > > That's a pretty good idea. Now, what format will the argument take: text > > (NOTICE, ERROR, DEBUG, etc) or integer? The increasing severity is clear > > with numbers but the correlation to NOTICE, ERROR etc is un

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > That's a pretty good idea. Now, what format will the argument take: text > (NOTICE, ERROR, DEBUG, etc) or integer? The increasing severity is clear > with numbers but the correlation to NOTICE, ERROR etc is undocumented > IIRC. On the other hand, the text

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-29 Thread Bruce Momjian
Gavin Sherry wrote: > On Thu, 29 Aug 2002, Tom Lane wrote: > > > Robert Treat <[EMAIL PROTECTED]> writes: > > > One of my users is generating a notice message --> NOTICE: Adding > > > missing FROM-clause entry for table "msg202" It might be helpful to > > > dump out the query on notice messages

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread Larry Rosenman
On Thu, 2002-08-29 at 19:04, Gavin Sherry wrote: > On Thu, 29 Aug 2002, Tom Lane wrote: > > > Robert Treat <[EMAIL PROTECTED]> writes: > > > One of my users is generating a notice message --> NOTICE: Adding > > > missing FROM-clause entry for table "msg202" It might be helpful to > > > dump out

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread Gavin Sherry
On Thu, 29 Aug 2002, Tom Lane wrote: > Robert Treat <[EMAIL PROTECTED]> writes: > > One of my users is generating a notice message --> NOTICE: Adding > > missing FROM-clause entry for table "msg202" It might be helpful to > > dump out the query on notice messages like this, and it looks like a

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread D'Arcy J.M. Cain
On August 29, 2002 12:09 pm, Robert Treat wrote: > One of my users is generating a notice message --> NOTICE: Adding > missing FROM-clause entry for table "msg202" It might be helpful to > dump out the query on notice messages like this, and it looks like a > simple change as far as elog.c and g

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes: > One of my users is generating a notice message --> NOTICE: Adding > missing FROM-clause entry for table "msg202" It might be helpful to > dump out the query on notice messages like this, and it looks like a > simple change as far as elog.c and guc.c are

Re: [HACKERS] Proposed GUC Variable

2002-08-29 Thread Robert Treat
One of my users is generating a notice message --> NOTICE: Adding missing FROM-clause entry for table "msg202" It might be helpful to dump out the query on notice messages like this, and it looks like a simple change as far as elog.c and guc.c are concerned, but would this be overkill? Robert T

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Bruce Momjian
Larry Rosenman wrote: > > > 3. Not sure what the "original" is for -- you're not transforming > > > anything. > > > > Agreed. Just call it "Error query". Seems clear to me. > What about rule(s) transformation(s)? Will we see the real query or the > transformed query? Well, looking at Gavin's

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Larry Rosenman
On Wed, 2002-08-28 at 14:05, Bruce Momjian wrote: > Peter Eisentraut wrote: > > Gavin Sherry writes: > > > > > Attached is the patch. debug_print_error_query is set to false by default. > > > > > > For want of a better phrase, I've prepended 'original query: ' to the > > > error message to highli

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Bruce Momjian
Peter Eisentraut wrote: > Gavin Sherry writes: > > > Attached is the patch. debug_print_error_query is set to false by default. > > > > For want of a better phrase, I've prepended 'original query: ' to the > > error message to highlight why it is in the log. > > >From your resident How-To-Name-S

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Peter Eisentraut
Christopher Kings-Lynne writes: > Do you think that 'original query: ..' looks a bit like bad english? Should > it be properly capitalised? ie. 'Original query: ...'? Just nitpicking... I find it's generally better to not capitalize anything in program messages, unless the sentence/paragraph

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Peter Eisentraut
Gavin Sherry writes: > Attached is the patch. debug_print_error_query is set to false by default. > > For want of a better phrase, I've prepended 'original query: ' to the > error message to highlight why it is in the log. >From your resident How-To-Name-Stuff Nitpicker: 1. The names of the deb

Re: [PATCHES] [HACKERS] Proposed GUC Variable

2002-08-28 Thread Christopher Kings-Lynne
l query: ...'? Just nitpicking... Chris > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Gavin Sherry > Sent: Wednesday, 28 August 2002 2:27 PM > To: Tom Lane > Cc: Hackers; [EMAIL PROTECTED] > Subject: Re: [PATCHES] [HACKERS] P

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Gavin Sherry
On Wed, 28 Aug 2002, Gavin Sherry wrote: > On Tue, 27 Aug 2002, Tom Lane wrote: > > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > But we should have some default to print some of the query, > > > > Why? So far you've been told by two different people (make that three > > now) that such a b

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Gavin Sherry
On Tue, 27 Aug 2002, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > But we should have some default to print some of the query, > > Why? So far you've been told by two different people (make that three > now) that such a behavior is useless, and no one's weighed in in its > fav

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread ngpg
[EMAIL PROTECTED] (Tom Lane) wrote > "Ross J. Reedstrom" <[EMAIL PROTECTED]> writes: >> I agree that a 'trimmed' query is likely to be useless, but the idea of >> printing the query on ERROR is a big win for me: > > Certainly. I think though that an on-or-off GUC option is sufficient. > We don'

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Bruce Momjian
OK, just go with a boolean and admins can decide if they want it. --- Tom Lane wrote: > "Ross J. Reedstrom" <[EMAIL PROTECTED]> writes: > > I agree that a 'trimmed' query is likely to be useless, but the idea of > > printin

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Karl DeBisschop
On Tue, 2002-08-27 at 17:17, Larry Rosenman wrote: > On Tue, 2002-08-27 at 16:14, Bruce Momjian wrote: > > Larry Rosenman wrote: > > > > But we should have some default to print some of the query, because > > > > right now we print none of it. I am not saying it is perfect, but it is > > > > bette

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Rod Taylor
> > A settable trim length would probably be a good idea, I suppose, for > > those slinging 'bytea' and toasted texts around. > Yes, but the default should be NO TRIM or in 1K-4K range. IMHO Ditto. ---(end of broadcast)--- TIP 1: subscribe and un

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Tom Lane
"Ross J. Reedstrom" <[EMAIL PROTECTED]> writes: > I agree that a 'trimmed' query is likely to be useless, but the idea of > printing the query on ERROR is a big win for me: Certainly. I think though that an on-or-off GUC option is sufficient. We don't need a length, and we definitely don't need

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Larry Rosenman
On Tue, 2002-08-27 at 17:30, Ross J. Reedstrom wrote: > On Tue, Aug 27, 2002 at 06:08:40PM -0400, Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > But we should have some default to print some of the query, > > > > Why? So far you've been told by two different people (make tha

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Ross J. Reedstrom
On Tue, Aug 27, 2002 at 06:08:40PM -0400, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > But we should have some default to print some of the query, > > Why? So far you've been told by two different people (make that three > now) that such a behavior is useless, and no one's wei

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > But we should have some default to print some of the query, Why? So far you've been told by two different people (make that three now) that such a behavior is useless, and no one's weighed in in its favor ... regards, tom lane

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Larry Rosenman
On Tue, 2002-08-27 at 16:14, Bruce Momjian wrote: > Larry Rosenman wrote: > > > But we should have some default to print some of the query, because > > > right now we print none of it. I am not saying it is perfect, but it is > > > better than what we have, and is a reasonable default. > > On an e

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Bruce Momjian
Larry Rosenman wrote: > > But we should have some default to print some of the query, because > > right now we print none of it. I am not saying it is perfect, but it is > > better than what we have, and is a reasonable default. > On an error, you may not be able to reproduce it. Why not print th

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Larry Rosenman
On Tue, 2002-08-27 at 16:05, Bruce Momjian wrote: > Larry Rosenman wrote: > > On Tue, 2002-08-27 at 15:54, Bruce Momjian wrote: > > > > > > I had an idea on this. It seems pretty pointless to show a query error > > > without a query, but some queries are very large. > > > > > > How about if we

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Bruce Momjian
Rod Taylor wrote: > On Tue, 2002-08-27 at 16:54, Bruce Momjian wrote: > > > > I had an idea on this. It seems pretty pointless to show a query error > > without a query, but some queries are very large. > > > > How about if we print only the first 80 characters of the query, with > > newlines,

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Bruce Momjian
Larry Rosenman wrote: > On Tue, 2002-08-27 at 15:54, Bruce Momjian wrote: > > > > I had an idea on this. It seems pretty pointless to show a query error > > without a query, but some queries are very large. > > > > How about if we print only the first 80 characters of the query, with > > newlin

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Rod Taylor
On Tue, 2002-08-27 at 16:54, Bruce Momjian wrote: > > I had an idea on this. It seems pretty pointless to show a query error > without a query, but some queries are very large. > > How about if we print only the first 80 characters of the query, with > newlines, tabs, and spaces reduced to a si

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Larry Rosenman
On Tue, 2002-08-27 at 15:54, Bruce Momjian wrote: > > I had an idea on this. It seems pretty pointless to show a query error > without a query, but some queries are very large. > > How about if we print only the first 80 characters of the query, with > newlines, tabs, and spaces reduced to a si

Re: [HACKERS] Proposed GUC Variable

2002-08-27 Thread Bruce Momjian
I had an idea on this. It seems pretty pointless to show a query error without a query, but some queries are very large. How about if we print only the first 80 characters of the query, with newlines, tabs, and spaces reduced to a single space, and send that as LOG to the server logs. That wou