Re: [SQL] to_date function

2007-09-07 Thread Tom Lane
"A. Kretschmer" <[EMAIL PROTECTED]> writes: > am Fri, dem 07.09.2007, um 17:22:30 +1200 mailte anru chen folgendes: >> seems like "to_date" function only work correctly for current month. > No, seems like to_char only work corrently if the length of the month > correctly... You need to use FMMon

Re: [SQL] Failing join with set returning function

2007-09-07 Thread [EMAIL PROTECTED]
Please, remove my address from this Mailing List. thanks -- Leggi GRATIS le tue mail con il telefonino i-modeĀ™ di Wind http://i-mode.wind.it/

[SQL] SERIAL type's sequence is double-called or ?

2007-09-07 Thread Aleksandr Vinokurov
Hello all, I have a question with the SERIAL type. I want to use it for default identification of table entries: create table chuwee ( num serial primary key, mesg varchar(50) not null ); And all the inserts to this table I'm gonna log to this table: create table chuwee_log ( id seri

Re: [SQL] SERIAL type's sequence is double-called or ?

2007-09-07 Thread Richard Huxton
Aleksandr Vinokurov wrote: Logging will be done with this rule: create or replace rule chuwee_rule as on insert to chuwee do insert into chuwee_log (num, mesg) values (new.num, new.mesg); Don't do logging with rules, do logging with triggers. See mailing-list archives for details. -- R

[SQL] Failing join with set returning function

2007-09-07 Thread Bart Degryse
I've written a function that calculates the number of days for every month in a given range and returns that as a set of records. CREATE OR REPLACE FUNCTION general_daysinmonth( date1 IN date, date2 IN date, month OUT date, days OUT integer) RETURNS SETOF record AS $body$ DECLARE startda

Re: [SQL] to_date function

2007-09-07 Thread A. Kretschmer
am Fri, dem 07.09.2007, um 10:25:57 -0400 mailte Tom Lane folgendes: > "A. Kretschmer" <[EMAIL PROTECTED]> writes: > > am Fri, dem 07.09.2007, um 17:22:30 +1200 mailte anru chen folgendes: > >> seems like "to_date" function only work correctly for current month. > > > No, seems like to_char only