Re: PL/SQL & unset custom variable

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: PL/SQL & unset custom variable
Дата
Msg-id 20090902143929.GA6774@tux
обсуждение исходный текст
Ответ на PL/SQL & unset custom variable  (Gordon Ross <gr306@ucs.cam.ac.uk>)
Ответы Re: PL/SQL & unset custom variable  (Gordon Ross <gr306@ucs.cam.ac.uk>)
Список pgsql-general
Gordon Ross <gr306@ucs.cam.ac.uk> wrote:

> (I'm using Postgres 8.3)
>
> I have a trigger that references a custom variable. Most of the time this
> custom variable is set, and I have no problems.
>
> However, in certain corner cases the custom variable is not set and the
> trigger fails.
>
> Is there a way to either test if the custom variable is set, or to specify a
> global default for the custom variable ?

I think, you can use COALESCE(your_variable, default_value) to solve
that problem. Try it, it is untested.



Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Wellmann, Harald"
Дата:
Сообщение: Subselect problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Ungooglable error message when running initdb: Symbol not found: _check_encoding_conversion_args