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

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

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5448: psql \set does not terminate if variable is referenced recursively
Date: 2010-05-09 10:58:35
Message-ID: hs64gr$1hm$ (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On 2010-05-05, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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 expansions.  So I think we need to add
> an explicit recursion test and suppress further expansion of the
> variable when we see it, but there's no very simple way to just abandon
> the current command altogether.

having not examined the code I immagine something like this could work.

fputs(stgerr,"recursive expansion\n");
return "";

> We can definitely print a message though, and I agree that just silently
> suppressing recursion would be confusing.

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-05-09 15:35:24
Subject: Re: bool: symbol name collision
Previous:From: KOIZUMI SatoruDate: 2010-05-09 03:21:37
Subject: BUG #5455: two PGTYPES_NUM_OVERFLOWs

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