pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Mathias Mayrhofer <mtmayr@mtmayr.com>
To: pgsql-general@postgresql.org
Subject: Re: escape vs. bytea in config
Date: Tue, 07 Mar 2023 13:35:09 +0100
Message-ID: <7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at> (raw)
In-Reply-To: <ab608b9b-862b-c773-ea6f-298b9da6a898@mtmayr.com>
References: <ab608b9b-862b-c773-ea6f-298b9da6a898@mtmayr.com>

On Tue, 2023-03-07 at 11:53 +0100, Mathias Mayrhofer wrote:
> -- /etc/postgresql/14/main/postgresql.conf
> -- bytea_output = 'escape'
> 
> db=> select encode(digest('mtmayr', 'sha256'), 'escape');
> ┌────────────────────────────────────────────────────────────────────────────────────────────┐
> │                                           encode                                           │
> ├────────────────────────────────────────────────────────────────────────────────────────────┤
> │ \277\x19\225\335g\307\224\337-\347Y\203\254\324\x1Ff\307Ph*\267\\\243\2515S\213WX\204\375G │
> └────────────────────────────────────────────────────────────────────────────────────────────┘
> 
> db=> select digest('mtmayr', 'sha256');
> ┌────────────────────────────────────────────────────────────────────────────────────────────┐
> │                                           digest                                           │
> ├────────────────────────────────────────────────────────────────────────────────────────────┤
> │ \277\031\225\335g\307\224\337-\347Y\203\254\324\037f\307Ph*\267\\\243\2515S\213WX\204\375G │
> └────────────────────────────────────────────────────────────────────────────────────────────┘
> 
> --    ^^  differences                             ^^^^

They are actually the same: octal 31 is hexadecimal 19.

The difference is between the "encode" function and the type putput function of "bytea".

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com


view thread (3+ messages)  latest in thread

Message-ID: <7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at>
Permalink:  ../7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at/
Also on:    postgresql.org/message-id/7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, mtmayr@mtmayr.com
  Subject: Re: escape vs. bytea in config
  In-Reply-To: <7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at>
  References: <ab608b9b-862b-c773-ea6f-298b9da6a898@mtmayr.com> <7c9dddd89d923275e9b5083100f75dfa4f169e9d.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox