Re: [HACKERS] Re: psql and comments - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: psql and comments
Date
Msg-id 1128.939338895@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: psql and comments  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: psql and comments  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>>>> That is fixed now.
>> 
>> Is it?  postgres.c treats an all-whitespace input as an empty query,
>> but if you pass it a comment and nothing else it will cycle the parser/
>> planner/executor, and I'm not sure every phase of that process behaves
>> reasonably on empty input.  Also, that path will not produce the
>> "empty query" response code that you get from all-whitespace input.
>> I *think* libpq doesn't depend on that anymore, but other frontend
>> libraries might...

>     postgres -D /u/pg/data test
>     POSTGRES backend interactive interface 
>     $Revision: 1.130 $ $Date: 1999/09/29 16:06:10 $
backend> -- test
backend> 

> Is that what you mean?    

OK, so the parser/planner/executor can cope with dummy input.  That's
good.  There's still the problem of returning an 'empty query' response
to the frontend.  I think you'd probably need to hack up postgres.c
so that when the querytree list produced by the parser is NIL, the
IsEmptyQuery flag gets set --- this could be done instead of, rather
than in addition to, the current test for an all-whitespace input
buffer.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Top N queries and disbursion
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: Top N queries and disbursion