Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Farina <daniel@heroku.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2013-03-15T03:07:33Z
Lists: 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


Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix postgres_fdw's issues with inconsistent interpretation of data values.