Re: I'm stuck - I just can't get this small FUNCT to run!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ralph Smith <rsmith(at)10kinfo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: I'm stuck - I just can't get this small FUNCT to run!
Date: 2010-11-04 03:50:08
Message-ID: 19968.1288842608@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Ralph Smith <rsmith(at)10kinfo(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dean Gibson (DB Administrator) 2010-11-04 19:03:48 Trailing spaces - is there an easier way?
Previous Message bricklen 2010-11-04 00:09:09 Re: I'm stuck - I just can't get this small FUNCT to run!