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

Search Discussions

  • Tom Lane at Jan 26, 2010 at 7:19 pm

    Robert Haas 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
  • Robert Haas at Jan 26, 2010 at 7:22 pm

    On Tue, Jan 26, 2010 at 2:12 PM, Tom Lane wrote:
    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.
    Ah, makes sense. Thanks.

    ...Robert

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJan 26, '10 at 6:35p
activeJan 26, '10 at 7:22p
posts3
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Robert Haas: 2 posts Tom Lane: 1 post

People

Translate

site design / logo © 2021 Grokbase