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

2006-07-25 Thread Chris Browne
[EMAIL PROTECTED] (Tom Lane) writes:
> Chris Browne <[EMAIL PROTECTED]> writes:
>> Unfortunately (perhaps) standards_conforming_strings does not appear
>> to be exported, so I'm not sure how to do this otherwise.
>
> Perhaps your problem is one of spelling?  It's
> "standard_conforming_strings", and it's certainly a global variable.
>
> You still haven't explained why you need this, though.  There are
> no datatype output functions that examine this variable.

Apologies.  I was reading too much into the problem report.

After some discussion on IRC, I think we've "simplified" things back
to what the problem is.

Our logtrigger() function is already applying a "non-SCS" policy to
quote backslashes.  No need to declare anything there, as had been the
case with a recent DateStyle issue.

With DateStyle, we had to control the style in two places:
 1.  In logtrigger(), when PostgreSQL is asked to generate the
 string version of a datestamp.  We do so by temporarily
 setting DateStyle.
 2.  When loading data, we need to make sure the connection
 uses a consistent DateStyle.  We do so by setting the GUC
 variable using SET.

I was under the misapprehension that we needed something akin to that
step 1; apparently we only need worry about step 2.  To which Peter's
suggestion is entirely sufficient.

Sorry about the confusion.
-- 
let name="cbbrowne" and tld="ntlug.org" in name ^ "@" ^ tld;;
http://cbbrowne.com/info/internet.html
"Who is General Failure and why is he reading my hard disk?" 
-- <[EMAIL PROTECTED]>, Felix von Leitner

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


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

2006-07-25 Thread Tom Lane
Chris Browne <[EMAIL PROTECTED]> writes:
> Unfortunately (perhaps) standards_conforming_strings does not appear
> to be exported, so I'm not sure how to do this otherwise.

Perhaps your problem is one of spelling?  It's
"standard_conforming_strings", and it's certainly a global variable.

You still haven't explained why you need this, though.  There are
no datatype output functions that examine this variable.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


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

2006-07-25 Thread Chris Browne
[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


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

2006-07-24 Thread Tom Lane
Chris Browne <[EMAIL PROTECTED]> writes:
> 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

This is a good idea why exactly?  What are you even expecting it to do?
The backend doesn't use standard_conforming_strings to determine any
output, other than in ruleutils.c which I didn't think Slony uses.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


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

2006-07-24 Thread Peter Eisentraut
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?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[HACKERS] Help! - Slony-I - saving/setting/restoring GUC

2006-07-24 Thread Chris Browne
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

The variable, standards_conforming_string, does not appear to be
widely exported, but rather seems pretty localized to guc.c

This is the prime thing holding us from RC2.

Tom, Peter, you have touched guc.c in the context of
standards_conforming_string; perahps you can suggest something?  Darcy
and I aren't seeing what to do...
-- 
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://www3.sympatico.ca/cbbrowne/
Why do we drive on parkways and park on driveways?

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org