Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)
Date
Msg-id 19774.1363316853@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)  (Daniel Farina <daniel@heroku.com>)
Responses Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)  (Daniel Farina <daniel@heroku.com>)
List pgsql-hackers
Daniel Farina <daniel@heroku.com> writes:
> On Tue, Mar 12, 2013 at 11:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Yeah, watching the remote side's datestyle and intervalstyle and
>> matching them (for both input and output) would probably work.

> Alright, so I've been whacking at this and there's one interesting
> thing to ask about: saving and restoring the local GUCs.  There are a
> bunch of things about GUCs besides their value that are maintained,
> such as their 'source', so writing a little ad-hoc save/restore is not
> going to do the right thing.

Right, you should use NewGUCNestLevel/AtEOXact_GUC.  Look at the fixes
I committed in postgres_fdw a day or two ago for an example.

> So, I can add one more such use of AtEOXact_GUC for the dblink fix,
> but would it also be appropriate to find some new names for the
> concepts (instead of AtEOXact_GUC and isCommit) here to more
> accurately express what's going on?

Meh.  I guess we could invent an "EndGUCNestLevel" that's a wrapper
around AtEOXact_GUC, but I'm not that excited about it ...
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Next
From: Robert Haas
Date:
Subject: Re: [v9.3] writable foreign tables