Re: Trigger and Trigger function, Part 2
| От | Michael Fuhr |
|---|---|
| Тема | Re: Trigger and Trigger function, Part 2 |
| Дата | |
| Msg-id | 20050617172111.GA73750@winnie.fuhr.org обсуждение исходный текст |
| Ответ на | Trigger and Trigger function, Part 2 (Matt Iskra <Matt.Iskra@doj.ca.gov>) |
| Список | pgsql-novice |
On Fri, Jun 17, 2005 at 09:37:23AM -0700, Matt Iskra wrote: > > CREATE FUNCTION > oc.upd_last_touch() > RETURNS TRIGGER AS > $upd_last_touch$ > BEGIN > NEW.last_touch := current_timestamp; > RETURN NEW; > END; > $upd_last_touch$ > LANGUAGE 'plpgsql' VOLATILE; > > However, PostgreSQL is STILL giving me a syntex error on line two > of the above function. The exact text is: > > ERROR: syntax error at or near "FUNCTION" at character 16. I created an oc schema and used psql to copy the above code into a database with no problems. Have you tried using psql instead of pgAdmin III? In the image you attached, there's a marker on the left side of the line that contains oc.upd_last_touch(), and it looks like the cursor is just after the dot. Are those significant, perhaps showing where the problem is? I don't use pgAdmin III -- does it have trouble with schema-qualified function names? What happens if you omit "oc." and make the function name simply upd_last_touch? -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-novice по дате отправления: