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

2010-02-26 Thread Tom Lane
Petru Ghita 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 type|

[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 i

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

2010-02-26 Thread Tom Lane
"A. Kretschmer" 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(); ERRO

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 3

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 pl

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 FRO