doing %-expansion in plpgsql RAISE USING

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема doing %-expansion in plpgsql RAISE USING
Дата
Msg-id 20090804132708.GA6494@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: doing %-expansion in plpgsql RAISE USING  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: doing %-expansion in plpgsql RAISE USING  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hi,

It seems there's no way to do %-expansion in plpgsql when one is using
RAISE USING:

alvherre=# create or replace function f () returns void language plpgsql as $$
begin raise using message = 'hello %' || 'world'; return;
end;
$$;
CREATE FUNCTION
alvherre=# select f();
ERROR:  hello %world


I would like the % to be expanded to some argument, but obviously
there's no way to pass the arguments that it should expand to.  We could
do something like

RAISE USING message = 'hello %st %', args = 1, 'world'

but this is obviously going to be difficult, if not impossible, to
implement in the grammar.  Perhaps 
RAISE USING message = 'brave %st %', args = (1, 'world')

Thoughts?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: Tsutomu Yamada
Дата:
Сообщение: Re: Proposal: More portable way to support 64bit platforms
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SE-PostgreSQL Specifications