what exactly is a query structure?

From: silly sad <sad(at)bankir(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: what exactly is a query structure?
Date: 2010-02-26 06:50:11
Message-ID: 4B876F23.8040401@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

hello.

Postgresql 8.3.9

CREATE TYPE usr_secrets AS (login TEXT, pass TEXT, shop_pass TEXT);

CREATE OR REPLACE FUNCTION get_noobs () RETURNS SETOF usr_secrets AS $$
BEGIN
RETURN QUERY SELECT login, '*' as pass, shop_pass FROM noob;
RETURN;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;

SELECT * from get_noobs();

And we have the following error

ERROR: structure of query does not match function result type

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2010-02-26 07:19:01 Re: what exactly is a query structure?
Previous Message Tom Lane 2010-02-25 15:28:56 Re: Using new.id in the WHERE condition of one UPDATE inside ON INSERT rule