Re: Problem with inserting into a triggerable table;

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Problem with inserting into a triggerable table;
Дата
Msg-id 20040326145352.M77876@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Problem with inserting into a triggerable table;  (Anoop Rajendra <axr3845@omega.uta.edu>)
Список pgsql-general
On Thu, 25 Mar 2004, Anoop Rajendra wrote:

> Hi, I was having some problems with inserting into a table with a trigger
> function attached.
>
> My code is shown below -
> CREATE OR REPLACE FUNCTION update_tv_prefs() RETURNS trigger AS '
> BEGIN
>         SELECT * FROM tvprefs WHERE ch_number = NEW.id AND time_of_day =
> get_time() as X;

This "as X" is invalid I believe.

> Here, I dont have problems creating either the trigger or the function.
> Nor did I have any problems with the language before. I wrote another
> function with pretty much the same syntax ( not a trigger function though)
> and I didnt get any errors.
> But when I try to insert into the TV table, I get a error telling me -
>
> ERROR:  syntax error at or near "as" at character 76
> CONTEXT:  PL/pgSQL function "update_tv_prefs" line 2 at SQL statement

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Native Win32 port - PLEASE!
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: pg_dump "what if?"