Skip site navigation (1) Skip section navigation (2)

Re: arrays and functions in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Todd Kover <kovert(at)omniscient(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: arrays and functions in plpgsql
Date: 2004-09-18 01:41:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Todd Kover <kovert(at)omniscient(dot)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 ... ]

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

In response to

pgsql-novice by date

Next:From: M. BastinDate: 2004-09-18 12:44:20
Subject: Re: ERROR: COPY <Table Name> FROM <file>
Previous:From: Todd KoverDate: 2004-09-18 00:31:13
Subject: Re: arrays and functions in plpgsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group