Re: arrays and functions in plpgsql - Mailing list pgsql-novice

From Tom Lane
Subject Re: arrays and functions in plpgsql
Date
Msg-id 27899.1095471673@sss.pgh.pa.us
Whole thread Raw
In response to Re: arrays and functions in plpgsql  (Todd Kover <kovert@omniscient.com>)
List pgsql-novice
Todd Kover <kovert@omniscient.com> writes:
> indeed I did.  Still have the same problem, though:

> create or replace function float8_jitter_add(float8[], interval)
> ...
> testdb=# select float8_jitter_add('{.1,.2,.3,1}', 5);
> ERROR:  "$1" is declared CONSTANT
> CONTEXT:  compile of PL/pgSQL function "float8_jitter_add" near line 12

Hmm, that's weird ... [ cut ... paste ... ]

...
CREATE FUNCTION
regression=# select float8_jitter_add('{.1,.2,.3,1}', 5);
ERROR:  function float8_jitter_add("unknown", integer) does not exist
HINT:  No function matches the given name and argument types. You may need to add explicit type casts.

[ think ... ]  Oh.  You are creating float8_jitter_add(float8[], interval)
whereas this call is going to invoke float8_jitter_add(float8[], integer)
or something compatible with that.  You're seeing a syntax error in a
different, pre-existing function with a similar name.

FWIW, 8.0 has a number of improvements in error reporting that will
hopefully make this sort of problem more transparent.

            regards, tom lane

pgsql-novice by date:

Previous
From: Todd Kover
Date:
Subject: Re: arrays and functions in plpgsql
Next
From: Kumar S
Date:
Subject: ERROR: COPY FROM