Re: Confused by misleading error message on SP creation

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Confused by misleading error message on SP creation
Date: 2007-01-09 11:55:27
Message-ID: 20070109115527.GB8359@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2007-01-09 11:59:43 Re: Confused by misleading error message on SP creation
Previous Message Gregory S. Williamson 2007-01-09 11:42:47 Confused by misleading error message on SP creation