psql history vs. dearmor (pgcrypto)

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: psql history vs. dearmor (pgcrypto)
Date: 2011-11-14 02:35:28
Message-ID: 4EC07E70.40105@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've noticed that psql query buffer somehow interferes with dearmor
(from pgcrypto), corrupting the data. For example this works fine:

SELECT dearmor('-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.17 (GNU/Linux)

mQGiBE7AfUoRBACpupjE5tG9Fh1dWe2kb/yX+lNlMLpwMj1hjTrJo1cYmSYixkGX
Si90ZIjn0IOSU7XOkFai8btpbFGyGSdaB9BQK7s8ItN/wx9IHcnB83Lbex3aF/VS
hN81VummzKQ0YB+Crwp1mu1l76UrTg6sPnY+wHj3jPOleXcX9L9UAAzOnwCgi4OS
JoRzR/pPiWtW0Nk5qnYhuZMD/RyNYbKkoNVO4WUnfOFMqm2zIqRXmMnkXS6gNPsd
RNVXb4ByFSzugsZKW5ez9+zS0G0aarySQIuGgPGKSeZezYtwKR3DH676MmdnNSvx
GiGDQW+hSXBOiBOmxhZfBK8H6JfmEtUpZwA8tkzD0u6ikZjQZR0cRux/tdutzTuZ
YGyaA/4tWzKtQP+WDi5tUPNO1/7EcBphYMvZDfNzYUn5ZwXzw5B5YSi0rdY6ZLSP
H3X8hrHbSmDrD8KseLtl9E4YvaOWd0BZCg9QwUcVrR+9sYtyNy/ztX++vVOtFjQ6
b19rj0853fwSgv9gHoNelmBXs0jTDGaKSBwzTD8GYtusQcu3lbQZYWFhYWEgPGFh
YWFhQGV4YW1wbGUuY29tPohiBBMRAgAiBQJOwH1KAhsDBgsJCAcDAgYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCNcpg0BUjyDOKPAJ4viutaojyBhV0ICJED09ArUXgZ7ACf
U6CX156L6i6x8UzRLFxsvVKHXIK5AQ0ETsB9ShAEAMDqwXmBeJGqWgXrtVKh6XIw
uanQtl/lIhktVcAYa/FHnvleL9RqI6JpiVWuvLfOdDcUQmh3MvsmD6h6plVmg/bz
/y1ZGnWANjCazmSWDjTfuIX+wuWo4TKSRhXzUd5tw5bgaeC0Hvy+rlgswRILFYL1
5I0/NTm+fFkB0McY9E2fAAMHBACgpmaAW/VR4IGn+j74GCzn2W06UnnWSK7A0GPJ
kUiJa37mv04yCeIqmoTVkl5rnz8dZZUwJVKYwlRvvLB/omIdzRkouhK/QWioRQ+M
B5qPXjRNrcUnruWVzC3XfhZ6sImI8bh2tHpN1/r0hHXFb/5078Bv2d4Cq2WdMZJo
oGDxBIhJBBgRAgAJBQJOwH1KAhsMAAoJEI1ymDQFSPIM7RcAn22lbnWNWiGby9SU
mEQSkrE34O8+AKCFFPLQiCs3/EL3+2DsplWOnEcSuQ==
=Q6Oq
-----END PGP PUBLIC KEY BLOCK-----');

but recalling it from the query buffer results in

ERROR: Corrupt ascii-armor

I've noticed this on 9.1 but 9.2devel behaves exactly the same. I'm
using 64-bit Linux with UTF8, nothing special.

Tomas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-14 02:40:49 Re: why do we need two snapshots per query?
Previous Message Robert Haas 2011-11-14 02:25:15 Re: FDW system columns