Re: Help! - Slony-I - saving/setting/restoring GUC - Mailing list pgsql-hackers

From Chris Browne
Subject Re: Help! - Slony-I - saving/setting/restoring GUC
Date
Msg-id 60lkqhbrhe.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Help! - Slony-I - saving/setting/restoring GUC  (Chris Browne <cbbrowne@acm.org>)
Responses Re: Help! - Slony-I - saving/setting/restoring GUC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
peter_e@gmx.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.]


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Freezing tuples on pages dirtied by vacuum
Next
From: Tom Lane
Date:
Subject: Re: On-disk bitmap index patch