Re: Confused by misleading error message on SP creation - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Confused by misleading error message on SP creation
Date
Msg-id 20070109115527.GB8359@svana.org
Whole thread Raw
In response to Confused by misleading error message on SP creation  ("Gregory S. Williamson" <gsw@globexplorer.com>)
List pgsql-general
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.

Attachment

pgsql-general by date:

Previous
From: "Gregory S. Williamson"
Date:
Subject: Confused by misleading error message on SP creation
Next
From: "Gregory S. Williamson"
Date:
Subject: Re: Confused by misleading error message on SP creation