Re: pgcrypto: PGP armor headers

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgcrypto: PGP armor headers
Date: 2014-09-30 15:39:47
Message-ID: 542ACEC3.5030004@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/30/14 5:17 PM, Heikki Linnakangas wrote:
> I'm actually now leaning towards providing just a single function,
> pgp_armor_headers(text, key OUT text, value OUT text), which returns all
> the keys and values. That gives maximum flexibility, and leaves it up to
> the user to decide what to do with duplicate keys. It's pretty easy to
> use that to extract just a single header, too:
>
> <snip>
>
> What do you think? Attached patch implements that, but the docs and
> regression tests now need adjustment.

(You forgot the patch, but I can imagine what it would have been.)

I'm not exactly sure to be honest. I would personally like to see a
simple function for extracting a single header value in a scalar context
without having to deal with all the pain of SRFs, multiple matches and
no matches. Sure, that got a lot better in 9.3 with LATERAL but it's
still way inferior to pgp_armor_header().

I can also see why someone would argue that I should just create the
function myself and that it doesn't have to be shipped with postgres.
But on the other hand, this is already an extension one has to
explicitly go and CREATE, and that considered one more function probably
wouldn't hurt too much.

But either way I won't be unhappy, so it's up to you (and/or other
members of the community) to decide this one.

.marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-09-30 15:52:33 Re: WITH CHECK and Column-Level Privileges
Previous Message Simon Riggs 2014-09-30 15:30:57 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}