Re: what exactly is a query structure?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: what exactly is a query structure?
Date: 2010-02-26 15:11:56
Message-ID: 27166.1267197116@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> writes:
> In response to silly sad :
>> my own wild guess:
>> string constant '*' is of type "unknown"

> Maybe. Add a explicit cast, for instance '*'::text

Definitely. More recent versions of PG provide a more explicit error
message:

regression=# SELECT * from get_noobs();
ERROR: structure of query does not match function result type
DETAIL: Returned type unknown does not match expected type text in column "pass".
CONTEXT: PL/pgSQL function "get_noobs" line 2 at RETURN QUERY

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Petru Ghita 2010-02-27 03:08:31 Date comparison, user defined operators and magic
Previous Message A. Kretschmer 2010-02-26 09:53:58 Re: what exactly is a query structure?