From: silly sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: Re: what exactly is a query structure?
Date: Fri, 26 Feb 2010 12:44:35 +0300
Message-ID: <4B879803.5020006@bankir.ru> (raw)
In-Reply-To: <4B876F23.8040401@bankir.ru>
References: <4B876F23.8040401@bankir.ru>
On 02/26/10 09:50, silly sad wrote:
> 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
>
my own wild guess:
string constant '*' is of type "unknown"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sad@bankir.ru
Subject: Re: what exactly is a query structure?
In-Reply-To: <4B879803.5020006@bankir.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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