structure of query does not match error during RETURN QUERY.

From: Michal Szymanski <dyrex(at)poczta(dot)onet(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: structure of query does not match error during RETURN QUERY.
Date: 2009-05-08 09:22:39
Message-ID: 4909557a-b722-4214-9031-ef6ce4976e8a@r36g2000vbr.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
We call DB procedure that select rows with given ID it works as simple
SELECT but for future changes we implement as DB procedure (look below
for DB listing). Recently we modified columns in table
cerber.cerber_accoun and after this modification procedure does not
work anymore and it returns
42804: structure of query does not match
It is very strange because we return row of cerber_account in variable
defined as row of cerber_account.
We have tried to restart database but it does not help. Probably
information about old table structure is somewhere cached.

CREATE OR REPLACE FUNCTION cerber.cerber_account_select
(i_cerber_account_id bigint)
RETURNS SETOF cerber.cerber_account AS
$BODY$
DECLARE
v_result cerber.cerber_account%ROWTYPE;
BEGIN
RETURN QUERY SELECT * FROM cerber.cerber_account WHERE
cerber_account_id=i_cerber_account_id;
RETURN;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100
ROWS 1000;

Michal Szymankis
http://blog.szymanskich.net

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michal Szymanski 2009-05-08 09:25:05 Re: structure of query does not match error during RETURN QUERY.
Previous Message Massa, Harald Armin 2009-05-08 09:13:55 Accessing pg_controldata information from SQL