#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Output of Decode varies with postgres versions


    Any idea why the output of decode changes when I move from postgres 8.1 to 92. here is an example.

    Postgresql 8.1.23
    =================
    select decode('9d88a3f96604443b', 'hex');
    decode
    -------------------------
    \235\210\243\371f\004D;
    (1 row)

    Postgresql 9.2.4
    ================
    select decode('9d88a3f96604443b', 'hex');
    decode
    --------------------
    \x9d88a3f96604443b
    (1 row)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,781
    Rep Power
    348
    It always pays off to read the the release notes: http://www.postgresql.org/docs/curre...lease-9-0.html

    Originally Posted by Release notes
    bytea output now appears in hex format by default (Peter Eisentraut)

    The server parameter bytea_output can be used to select the traditional output format if needed for compatibility.
    For more details see the manual: http://www.postgresql.org/docs/curre...C-BYTEA-OUTPUT
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

IMN logo majestic logo threadwatch logo seochat tools logo