Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Erik Rijkers <er(at)xs4all(dot)nl>, Robert Haas <robertmhaas(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Date: 2017-02-14 23:03:15
Message-ID: alpine.DEB.2.20.1702142349280.16120@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

>> So moving the conditional stack back into PsqlScanState has some side
>> effects: conditional.[ch] have to move to the fe_utils/ dirs, and now
>> pgbench, which does not use conditionals, would have to link to them. Is
>> that a small price to pay for modularity and easier-to-find code? Or should
>> I just tuck it back into psqlscan_int.[ch]?
>
> Pardon me for coming in late, but what in the world has this to do with
> the lexer's state at all? IOW, I don't think I like either of what you're
> suggesting ...

The "lexer" state holds the stuff useful to psql to know where commands
start and stop, to process backslash commands, including counting
parenthesis and nested comments and so on... It seems logical to put the
"if" stack there as well, but if you think that it should be somewhere
else, please advise Corey about where to put it.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message neha khatri 2017-02-14 23:04:24 Re: bytea_output vs make installcheck
Previous Message Corey Huinker 2017-02-14 23:01:05 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)