help with TCL function

Поиск
Список
Период
Сортировка
От Jules Alberts
Тема help with TCL function
Дата
Msg-id 20030910132753.B5B7F1CB1D8@koshin.dsl.systemec.nl
обсуждение исходный текст
Ответы Re: help with TCL function  ("Jules Alberts" <jules.alberts@arbodienst-limburg.nl>)
Re: help with TCL function  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hello everybody,

Someone helped me earlier with this TCL trigger function:

create or replace function tlow() returns trigger as '
  set NEW($1) [string tolower $NEW($1)]
  return [array get NEW]'
language 'pltcl';

I use it to force lowercase of values inserted in the db. There is one
problem though, if the parameter is absent, the function will give an
error message. I would like it to rather check for null before tolower
is applicated. In semicode:

if ($1 <> NULL) {
    set NEW($1) [string tolower $NEW($1)]
}
return [array get NEW]'

but I have no idea how to do this in TCL. Can somebody please tell me?
Thanks a lot!

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

Предыдущее
От: Frank van Vugt
Дата:
Сообщение: plpgsql doesn't coerce boolean expressions to boolean
Следующее
От: Tom Lane
Дата:
Сообщение: Re: RE : How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?