pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ralph Smith <rsmith@10kinfo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: I'm stuck - I just can't get this small FUNCT to run!
Date: Wed, 03 Nov 2010 23:50:08 -0400
Message-ID: <19968.1288842608@sss.pgh.pa.us> (raw)
In-Reply-To: <4CD1F792.6040907@10kinfo.com>
References: <4CD1F792.6040907@10kinfo.com>

Ralph Smith <rsmith@10kinfo.com> writes:
> I'm also stuck on 7.4 for at least a few more months, but that's not 
> part of the problem.

... well, actually, it is; because newer versions give considerably more
helpful syntax error messages.  I tried plugging this function into
a current version, and got

syntax error at or near "daRec"
LINE 34:     FOR daRec IN SELECT * FROM temp_salesimport WHERE offer_...
                 ^

which was at least close enough to the problem (the missing semi on the
previous line) to be of some use, unlike the error pointing at line 92.
Similarly, after fixing the first missing semi I got

ERROR:  syntax error at or near "select"
LINE 38:       select into vBusOwnerID businessownerid from business ...
               ^

which is just after the other one.

If you aren't in a position to move your production DB yet, you might
at least consider using a newer version for development.  That has its
own hazards of course, like accidentally using features that don't exist
in 7.4, but it could save you a lot of time in cases like this.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <19968.1288842608@sss.pgh.pa.us>
Permalink:  ../19968.1288842608@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19968.1288842608@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, rsmith@10kinfo.com
  Subject: Re: I'm stuck - I just can't get this small FUNCT to run!
  In-Reply-To: <19968.1288842608@sss.pgh.pa.us>

* 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