pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Timothy Smith <timothy@open-networks.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: postgresql 8.01, plpgsql
Date: Mon, 14 Mar 2005 19:41:04 -0700
Message-ID: <20050315024104.GA59736@winnie.fuhr.org> (raw)
In-Reply-To: <42363BD1.6090405@open-networks.net>
References: <42363BD1.6090405@open-networks.net>

On Tue, Mar 15, 2005 at 11:35:13AM +1000, Timothy Smith wrote:

> i have the following function in plpgsql giving stynax errors all over 
> the place.

When I load the function you posted I get this:

test=> \i foo.sql
psql:foo.sql:87: ERROR:  syntax error at or near "END" at character 2851
psql:foo.sql:87: LINE 83:         END;
psql:foo.sql:87:                  ^

If I add a semicolon to the NULL statement in the exception handler
then it loads successfully.

> one thing to note is i followed this example 
> http://www.zigo.dhs.org/postgresql/#insert_or_update and it gives the 
> same errors.

I get no errors loading the example in the "Insert or Update" section
of that page.

> "ERROR:  unterminated dollar-quoted string at or near "$$
> BEGIN
> LOOP"

This looks like the parser is reaching EOF before the end of the
function body.  How are you loading the function?  I usually store code
in a file and use "psql -f filename" from the shell or "\i filename"
from the psql prompt.  If you're not already doing that, what happens
when you try it?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (4+ messages)  latest in thread

Message-ID: <20050315024104.GA59736@winnie.fuhr.org>
Permalink:  ../20050315024104.GA59736@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050315024104.GA59736@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, timothy@open-networks.net
  Subject: Re: postgresql 8.01, plpgsql
  In-Reply-To: <20050315024104.GA59736@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox