Re: [SQL] what exactly is a query structure?

2010-02-26 Thread silly sad
On 02/26/10 10:19, A. Kretschmer wrote: In response to silly sad : 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

Re: [SQL] what exactly is a query structure?

2010-02-26 Thread silly sad
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

Re: [SQL] what exactly is a query structure?

2010-02-26 Thread A. Kretschmer
In response to silly sad : my own wild guess: string constant '*' is of type unknown Maybe. Add a explicit cast, for instance '*'::text Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: - Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D

Re: [SQL] what exactly is a query structure?

2010-02-26 Thread Tom Lane
A. Kretschmer andreas.kretsch...@schollglas.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

[SQL] Date comparison, user defined operators and magic

2010-02-26 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everybody, I was missing a comparison operator for DATE so I wrote one after a really fast look into the documentation. Working with version 8.4. create or replace function vav_date_posterior(date, date) RETURNS boolean AS $$ - -- return TRUE

Re: [SQL] Date comparison, user defined operators and magic

2010-02-26 Thread Tom Lane
Petru Ghita petr...@venaver.info writes: Hello everybody, I was missing a comparison operator for DATE so I wrote one after a really fast look into the documentation. Huh? regression=# \do List of operators Schema | Name |Left arg