Lists: | pgsql-hackers |
---|
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | unfathomable comment in psqlscan.l |
Date: | 2010-01-26 18:35:08 |
Message-ID: | 603c8f071001261035i5ff4a8das6a0ed1d2786dba6c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
While reviewing Pavel's patch for variable quoting in psql, I came
upon the following comment in psqlscan.l:
/*
* The variable value is just emitted without any
* further examination. This is consistent with the
* pre-8.0 code behavior, if not with the way that
* variables are handled outside backslash commands.
*/
I cannot figure out for the life of me what this is referring to. It
seems to date back to 2004, when the old psql lexer was rewritten to
use flex. But I can't figure out what "further examination" someone
might have expected, or how it's inconsistent with the how things are
"handled outside backslash commands".
Help?
...Robert
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: unfathomable comment in psqlscan.l |
Date: | 2010-01-26 19:12:50 |
Message-ID: | 17356.1264533170@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> While reviewing Pavel's patch for variable quoting in psql, I came
> upon the following comment in psqlscan.l:
> /*
> * The variable value is just emitted without any
> * further examination. This is consistent with the
> * pre-8.0 code behavior, if not with the way that
> * variables are handled outside backslash commands.
> */
> I cannot figure out for the life of me what this is referring to.
At the other place where :foo is expanded, the value is pushed for
re-scanning; thus for example ":bar" within the variable value
might be further expanded as a reference to some other variable.
Inside backslash commands we don't do that but just take the value
literally.
regards, tom lane
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: unfathomable comment in psqlscan.l |
Date: | 2010-01-26 19:22:19 |
Message-ID: | 603c8f071001261122i7971cb16kd62e96dbbb4854dd@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Tue, Jan 26, 2010 at 2:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> While reviewing Pavel's patch for variable quoting in psql, I came
>> upon the following comment in psqlscan.l:
>
>> /*
>> * The variable value is just emitted without any
>> * further examination. This is consistent with the
>> * pre-8.0 code behavior, if not with the way that
>> * variables are handled outside backslash commands.
>> */
>
>> I cannot figure out for the life of me what this is referring to.
>
> At the other place where :foo is expanded, the value is pushed for
> re-scanning; thus for example ":bar" within the variable value
> might be further expanded as a reference to some other variable.
> Inside backslash commands we don't do that but just take the value
> literally.
Ah, makes sense. Thanks.
...Robert