FAQ
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?

Search Discussions

  • Peter Eisentraut at Jul 24, 2006 at 11:46 pm

    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?
  • Chris Browne at Jul 25, 2006 at 5:04 pm

    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.]
  • Tom Lane at Jul 25, 2006 at 5:15 pm

    Chris Browne 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
  • Chris Browne at Jul 25, 2006 at 7:04 pm

    Tom Lane writes:
    Chris Browne <cbbrowne@acm.org> 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?"
    -- <leitner@inf.fu-berlin.de>, Felix von Leitner
  • Tom Lane at Jul 25, 2006 at 4:26 am

    Chris Browne 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJul 24, '06 at 11:30p
activeJul 25, '06 at 7:04p
posts6
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase