Re: unfathomable comment in psqlscan.l - Mailing list pgsql-hackers

From Tom Lane
Subject Re: unfathomable comment in psqlscan.l
Date
Msg-id 17356.1264533170@sss.pgh.pa.us
Whole thread Raw
In response to unfathomable comment in psqlscan.l  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: unfathomable comment in psqlscan.l  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: testing cvs HEAD - HS/SR - missing file
Next
From: Simon Riggs
Date:
Subject: Re: Dividing progress/debug information in pg_standby, and stat before copy