Skip site navigation (1) Skip section navigation (2)

Re: defer statement logging until after parse

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: defer statement logging until after parse
Date: 2004-03-12 09:49:25
Message-ID: 405187A5.4060906@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:

>The problem I see with this patch is that it doesn't print the error
>query on a syntax error.  That seems wrong.
>

It does print it. In fact the example I gave below which is from a real 
trace shows it being printed. It is just printed after the error message 
rather than before.

You solution doesn't appear to address the problem of what to do if they 
ask for only DDL and one of those generates a syntax error.

cheers

andrew

>
>I think you should print the query before parsing if they are asking for
>all queries to be logged, and print them after parsing if they want only
>DDL or DDL and data modification queries.  I realize that duplicates
>some function calls, but I don't see any other way.
>
>---------------------------------------------------------------------------
>
>Andrew Dunstan wrote:
>  
>
>>The attached patch is for review, not application. It defers logging 
>>statements until after they have been parsed. There should be no 
>>observable difference in behaviour if there is a successful parse, and 
>>on error the following traces appear:
>>
>>  line:3 ERROR:  syntax error at or near "se3d2" at character 1
>>  line:4 LOG:  parse error in statement: se3d2 aaa;
>>
>>Basically, I want to know that this will not break anything, and if so I 
>>will use it as the basis for a selective statement logging facility, 
>>based on the command tag(s) of the parsed statement(s), and 
>>incorporating Greg Stark's suggesion of a "syntax error" logging level.
>>
>>cheers
>>
>>andrew
>>
>>    
>>
>
>  
>
>


In response to

Responses

pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-03-12 10:03:57
Subject: Re: initdb problen
Previous:From: Fabien COELHODate: 2004-03-12 09:41:11
Subject: Re: [HACKERS] notice about costly ri checks (3)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group