Re: quoting psql varible as identifier

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: quoting psql varible as identifier
Date: 2010-01-22 12:19:51
Message-ID: 162867791001220419hf3fcf30j8d7a57ad9f918ba7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

here is new variant. Add scan_state flag "valid" and enhance
protection against execution broken statement.

Regards
Pavel Stehule

2010/1/22 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> 2010/1/22 Robert Haas <robertmhaas(at)gmail(dot)com>:
>> On Thu, Jan 21, 2010 at 2:25 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>> 2010/1/21 Robert Haas <robertmhaas(at)gmail(dot)com>:
>>>> On Thu, Jan 21, 2010 at 12:53 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>>>> add to state structure field like lexer_error. This field will be
>>>>> checked before execution
>>>>> it could be ugly for metacommands, there will be lot of new checks :(
>>>>
>>>> Eh?  The only places where we should need new tests are the places
>>>> that check PQExpBufferBroken() now - there are only 6 calls to that
>>>> function in src/bin/psql and not all of them need to be changed.  The
>>>> places that do need to be changed will need to be modified to check
>>>> PQExpBufferBroken() || lexer_coughed_up_a_lung.
>>>
>>> no, it is only 6 calls because we don't check psql_scan_slash_option result.
>>
>> psql_scan_slash_option() already has a way to signal errors - it can
>> return NULL.  Type any backslash command followed by a single quote...
>
> NULL means "no value". But I thing, so there is only one important -
> \set. For other can be enough some error message and empty value.
>
>>
>> I'm not saying I love the way those errors are handled, but if we make
>> this patch about revising the way psql does error handling, this is
>> not going to get committed for this release...  what we need to do is
>> fit what we're trying to do into the existing model.
>>
>
> I try to find some simple and I'll send a patch.
>
> Pavel
>
>> ...Robert
>>
>

Attachment Content-Type Size
variables-escape.diff application/octet-stream 10.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Bunce 2010-01-22 12:43:01 Re: warn in plperl logs as... NOTICE??
Previous Message Simon Riggs 2010-01-22 11:54:01 Re: Access to dynamic SQL in PL/pgSQL