Re: Tigger

Поиск
Список
Период
Сортировка
От Bricklen Anderson
Тема Re: Tigger
Дата
Msg-id 42E14655.4090106@PresiNET.com
обсуждение исходный текст
Ответ на Tigger  ("David Hofmann" <mor4321@hotmail.com>)
Ответы Re: Tigger  ("David Hofmann" <mor4321@hotmail.com>)
Re: Tigger  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-sql
David Hofmann wrote:
> I've look throught the docs and from what I can see the bellow code
> should work, however I keep getting the error:
> 
> ERROR:  parser: parse error at or near "$" at character 53
> 
> CREATE FUNCTION session_update() RETURNS trigger AS $session_update$
> BEGIN
>     -- Check date exists
>     IF NEW.stamp_lastupdate IS NULL THEN
>         NEW.stamp_lastupdate := 'now';
>     END IF;
>     RETURN NEW;
> END;
> 
> $session_update$ LANGUAGE plpgsql;
> 
> CREATE TRIGGER session_update BEFORE INSERT OR UPDATE ON sessions FOR
> EACH ROW EXECUTE PROCEDURE session_update();
> 
> 
> Any help or suggestions of websites I should read would be appercated.
> 
> David

Which version of postgresql are you using? I don't believe that the "$" quoting
was available in older versions than 8 (or late 7?).

-- 
_______________________________

This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.
_______________________________


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

Предыдущее
От: "David Hofmann"
Дата:
Сообщение: Tigger
Следующее
От: "David Hofmann"
Дата:
Сообщение: Re: Tigger