Re: Help! - Slony-I - saving/setting/restoring GUC

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Help! - Slony-I - saving/setting/restoring GUC
Date: 2006-07-25 16:04:45
Message-ID: 60lkqhbrhe.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

peter_e(at)gmx(dot)net (Peter Eisentraut) writes:
> Chris Browne wrote:
>> In support of PG 8.2, we need to have the log trigger function do the
>> following:
>> - Save value of standards_conforming_string
>> - Set value of standards_conforming_string to FALSE
>> - proceed with saving data to sl_log_?
>> - Recover value of standards_conforming_string
>
> Would SET LOCAL help you?

Not really. The log trigger function is an SPI function, and I don't
think I want to be invoking an extra SQL request every time a tuple is
updated.

Consider our present handling of date localizations... Slony-I
prefers to operate using ISO dates. So the log trigger function must
force the datestyle correspondingly.

So our code looks like... (eliding irrelevant code)

int OldDateStyle = DateStyle;
DateStyle = USE_ISO_DATES;

/* code that generates data to stow in sl_log_n */

DateStyle = OldDateStyle; /* Retrieve user's local settings */

-------------------------------

At one point, I thought that we'd modify this to:
int OldDateStyle = DateStyle;
int OldSCS = standards_conforming_strings;
DateStyle = USE_ISO_DATES;
standards_conforming_strings = FALSE;

/* code that generates data to stow in sl_log_n */

DateStyle = OldDateStyle; /* Retrieve user's local settings */
standards_conforming_strings = OldSCS;

Unfortunately (perhaps) standards_conforming_strings does not appear
to be exported, so I'm not sure how to do this otherwise.
--
(reverse (concatenate 'string "gro.mca" "@" "enworbbc"))
http://www.ntlug.org/~cbbrowne/wp.html
Editing is a rewording activity.
-- Alan J. Perlis
[And EMACS a rewording editor. Ed.]

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-07-25 16:05:36 Re: Forcing current WAL file to be archived
Previous Message Bruce Momjian 2006-07-25 16:01:47 Re: Forcing current WAL file to be archived