Skip site navigation (1) Skip section navigation (2)

Re: Doing psql's lexing with flex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgreSQL(dot)org
Subject: Re: Doing psql's lexing with flex
Date: 2004-02-18 17:42:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Feel free (or encouraged) to change the old behavior.  (Of course, the 
> new behavior needs to adjustments, too.)  Generally, I think a variable 
> should just stand for a data value and should not result in a slash 
> command being generated.

That seems workable for :foo references in the body of a backslash
command --- you can just substitute the value but not allow it to be
split into multiple argument tokens.  However, wouldn't you still want
to rescan it for internal :bar references to other variables?  The psql
man page has some arm-waving about how you can do indirection, and seems
like that ought to work in this context too.

Also, this seems inconsistent with the non-backslash-command case.
Seems like you have to scan what goes into the query buffer to keep the
lexer state in sync, you can't just treat it as an uninterpreted token.
So not triggering on backslashes seems inconsistent.

We can certainly implement different behavior for the two cases, I'm
just unconvinced we should...

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2004-02-18 18:06:27
Subject: Re: NO WAIT ...
Previous:From: Peter EisentrautDate: 2004-02-18 17:33:59
Subject: Re: Doing psql's lexing with flex

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group