Re: pgcrypto: PGP armor headers

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: pgcrypto: PGP armor headers
Дата
Msg-id 542ACEC3.5030004@joh.to
обсуждение исходный текст
Ответ на Re: pgcrypto: PGP armor headers  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: pgcrypto: PGP armor headers  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: WITH CHECK and Column-Level Privileges