From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: create function syntax error |
Date: | 2006-07-29 20:42:30 |
Message-ID: | 20060729204230.GB16132@KanotixBox |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
gustavo halperin <ggh(dot)develop(at)gmail(dot)com> schrieb:
> Hello
>
> I Always get "syntax error" for every function that I try to create, for
> example:
> mydb'>create or replace function f_sum () returns void as '
> mydb'> select 2+2;
> mydb'> ' LANGUAGE plpgsql;
> ERROR: syntax error at or near "select" at character 56
> LINE 2: select 2+2;
> ^
>
> What its the problem ??
Several:
- wrong quotation, either with '' or with dollar-quote
- no 'begin'
- no 'end;'
Please read the docu:
http://www.postgresql.org/docs/8.1/interactive/plpgsql.html
There are many examples, for instance:
http://www.postgresql.org/docs/8.1/interactive/plpgsql-structure.html
HTH, 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." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
From | Date | Subject | |
---|---|---|---|
Next Message | Shoaib Mir | 2006-07-29 20:43:16 | Re: create function syntax error |
Previous Message | Andreas Kretschmer | 2006-07-29 20:38:15 | Re: Auto Installation |