Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-10 Thread Robert Haas
On Wed, May 5, 2010 at 1:50 PM, Tom Lane wrote: > The problem is there's no real support inside psql for "throwing an > error" --- we have to unwind all the state manually.  In particular, > what this problem requires is backing out the stack of flex buffers > representing pending variable expansi

Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Kevin Grittner
Tom Lane wrote: > I think we need to add an explicit recursion test and suppress > further expansion of the variable when we see it > We can definitely print a message Sounds perfect to me. -Kevin -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your sub

Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Tom Lane
"Kevin Grittner" writes: > Tom Lane wrote: >> We could print a message and treat the inner >> expansion as empty --- is that good enough? > If there's any way to throw an error, that seems better. I can > imagine someone getting confused by silent failure here. On the > other hand, since this

Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Kevin Grittner
Tom Lane wrote: > We could print a message and treat the inner > expansion as empty --- is that good enough? If there's any way to throw an error, that seems better. I can imagine someone getting confused by silent failure here. On the other hand, since this probably doesn't happen very often,

Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Tom Lane
"Kevin Grittner" writes: > "Francis" wrote: >> psql \set does not terminate if a variable is referenced >> recursively. For example, the following will hang the psql client >> in a nasty way: >> >> db=# \set n 1 >> db=# \set n (:n + 1) > It seem to me that the above doesn't hang the psql clie

Re: [BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Kevin Grittner
"Francis" wrote: > psql \set does not terminate if a variable is referenced > recursively. For example, the following will hang the psql client > in a nasty way: > > db=# \set n 1 > db=# \set n (:n + 1) It seem to me that the above doesn't hang the psql client, but a subsequent reference to

[BUGS] BUG #5448: psql \set does not terminate if variable is referenced recursively

2010-05-05 Thread Francis
The following bug has been logged online: Bug reference: 5448 Logged by: Francis Email address: fmark...@gmail.com PostgreSQL version: 8.4.3 Operating system: Ubuntu linux 10.04 Description:psql \set does not terminate if variable is referenced recursively Details: