Re: what exactly is a query structure?

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

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"

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2010-02-26 09:53:58 Re: what exactly is a query structure?
Previous Message silly sad 2010-02-26 09:42:04 Re: what exactly is a query structure?