Doh !  Thanks for the swift response ... bet you are right. Getting punch drunk 
on too many electrons ...

G


-----Original Message-----
From:   Martijn van Oosterhout [mailto:[EMAIL PROTECTED]
Sent:   Tue 1/9/2007 3:55 AM
To:     Gregory S. Williamson
Cc:     pgsql-general@postgresql.org
Subject:        Re: [GENERAL] Confused by misleading error message on SP 
creation

On Tue, Jan 09, 2007 at 03:42:47AM -0800, Gregory S. Williamson wrote:
> This is PostgreSQL 8.1.4, and I am utterly lost.

<snip>

> The error message:
> psql:e.sql:54: ERROR:  syntax error at or near "$2" at character 15
> QUERY:  SELECT   $1   $2  :=  $3
> CONTEXT:  SQL statement in PL/PgSQL function "client_year_usage_det" near 
> line 29
> psql:e.sql:54: LINE 1: SELECT   $1   $2  :=  $3
> psql:e.sql:54:  
> 
> Is of *NO* use. Could someone please explain what the hell it means ?
> There is no construct $1 $2 := $3 *anywhere*. There is no SELECT on
> line 54. Or line 29. What the heck is going here ?

Anything with a dollar sign is a parameter substituted by pl/pgsql.

Anyway, at line 29 of the function I see this:
>   clyud_rec.sp_is_subs := clyu_inrec.sp_is_subs

Missing semicolon at end of line. I think the $1 is the last paramater
there, and $2 and $3 the command on the next line.

As for speed decrease, you should trying working out which bit is
slow... If it's choosing a seq scan, maybe you havn't ANALYZE'd?

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.




---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to