[EMAIL PROTECTED] (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.] ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq