Re: Dynamic collation support
От | Pavel Stehule |
---|---|
Тема | Re: Dynamic collation support |
Дата | |
Msg-id | CAFj8pRCbS=zrgkvT9xfrSehOnt3p7zHbjOZ02pL8UF8fZMmPXQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Dynamic collation support (Merlin Moncure <mmoncure@gmail.com>) |
Ответы |
Re: Dynamic collation support
|
Список | pgsql-general |
2016-01-19 16:07 GMT+01:00 Merlin Moncure <mmoncure@gmail.com>:
For database functions, is there any way to manage collations besides
dynamic sql? It doesn't look like there is but I thought I'd ask.
For example, I want to do something like:
DO
$$
DECLARE
c name DEFAULT 'en_GB';
BEGIN
SELECT * FROM foo ORDER BY a COLLATE c;
END;
$$;
and not
DO
$$
DECLARE
c name DEFAULT 'en_GB';
BEGIN
EXECUTE 'SELECT * FROM foo ORDER BY a COLLATE ' || quote_ident(c);
END;
$$;
I understand this would disable all index supported sorting; that's ok.
Not being able to specify collation in a parameterized manner presents
some issues...I'm curious if there are workarounds.
Different collates requires different plans - so using dynamic SQL is much more correct.
It is same like using variables as columns or tablenames.
Regards
Pavel
merlin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
В списке pgsql-general по дате отправления: