Re: pgAdmin

From: Michael Stephenson <mstephenson(at)tirin(dot)openworld(dot)co(dot)uk>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: yulyanov(at)mera(dot)ru
Subject: Re: pgAdmin
Date: 2003-09-04 08:48:17
Message-ID: Pine.LNX.4.44.0309040843420.14211-100000@tirin.openworld.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> Error message see when compiling:
>
> ERROR: parser: parse error at or near "bigint" at character 16

You've declared your function as being written in SQL, and it looks like
it's in PL/pgSQL, the following works for me:

CREATE FUNCTION "get_new_id1" () RETURNS bigint AS'
declare
id bigint;
begin
id:=nextval(\'id_sequence\'::text);
return id;
end;
'LANGUAGE 'plpgsql' VOLATILE ;

You may need to run createlang plpgsql on your database first.

Michael

--
Web Applications Developer
Open World Ltd, 11 Riverside Court, Riverside Road, Bath, BA2 3DZ.
Tel: +44 1225 444950 Fax: +44 1225 336738 http://www.openworld.co.uk/

CONFIDENTIALITY NOTICE
The information contained in this message is confidential, intended only for
the use of the individual or the entity named as recipient. If the reader of
this message is not that recipient, you are notified that any
dissemination,
distribution or copy of this message is strictly prohibited. If you have
received this message in error, please immediately notify us by telephone on
the number above. Your co-operation is appreciated.

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-09-04 13:55:54 Re: Create function problem
Previous Message Yaroslav Ulyanov 2003-09-04 08:40:45 pgAdmin