pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedError message with a SQL function
3+ messages / 2 participants
[nested] [flat]
* Error message with a SQL function
@ 2003-08-08 14:13 krystoffff <proghome@silesky.com>
2003-08-09 15:16 ` Re: Error message with a SQL function Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: proghome@silesky.com @ 2003-08-08 14:13 UTC (permalink / raw)
To: pgsql-sql
Hi
I try to create the following SQL function:
CREATE FUNCTION update_affiliate(int,double precision,double
precision) RETURNS void AS ' UPDATE affiliate SET balance=balance +
$2, balance_in_points=balance_in_points + ( $2 / $3 ) WHERE id = $1; '
LANGUAGE 'sql';
but when I submit this query directly with PostgreSQL, I have the
following error message:
PostgreSQL said: ERROR: Unable to locate type oid 325664 in catalog
I think the problem comes from the first parameter ($1) but I don't
understand because affiliate.id is indeed the primary key of the table
affiliate.
Has anybody an idea ?
Thanks
Krystoffff
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error message with a SQL function
2003-08-08 14:13 Error message with a SQL function krystoffff <proghome@silesky.com>
@ 2003-08-09 15:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-08-13 13:25 ` Re: Error message with a SQL function krystoffff <proghome@silesky.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2003-08-09 15:16 UTC (permalink / raw)
To: proghome@silesky.com; +Cc: pgsql-sql
proghome@silesky.com (krystoffff) writes:
> CREATE FUNCTION update_affiliate(int,double precision,double
> precision) RETURNS void AS ' UPDATE affiliate SET balance=balance +
> $2, balance_in_points=balance_in_points + ( $2 / $3 ) WHERE id = $1; '
> LANGUAGE 'sql';
I don't believe there was a type "void" in PG 7.1. IIRC, back then the
custom was to say "RETURNS opaque" in this situation.
It's probably time for you to update to something newer ...
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Error message with a SQL function
2003-08-08 14:13 Error message with a SQL function krystoffff <proghome@silesky.com>
2003-08-09 15:16 ` Re: Error message with a SQL function Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-08-13 13:25 ` krystoffff <proghome@silesky.com>
0 siblings, 0 replies; 3+ messages in thread
From: proghome@silesky.com @ 2003-08-13 13:25 UTC (permalink / raw)
To: pgsql-sql
Thanks
You were right, it was because of the return void
But I think in the documentation, I read somewhere that this kind of
return was allowed ... I must have mistaken ...
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-08-13 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-08-08 14:13 Error message with a SQL function krystoffff <proghome@silesky.com>
2003-08-09 15:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-08-13 13:25 ` krystoffff <proghome@silesky.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox