Re: [SQL] plpgsql - Insert from a record variable?

2004-06-19 Thread Riccardo G. Facchini
--- Phil Endecott __ wrote: Dear Postgresql experts, I'm writing a simple plpgsql function that selects a row from a table, modifies it slightly, and inserts the modified version. This sounds simple, but I can't find how to do the insert in a simple generic fashion: although SELECT has a

Re: [SQL] case stement when null

2004-06-19 Thread Riccardo G. Facchini
--- Jaime Casanova __ wrote: hi all, Well i rethink my design 'cause the other was too slow. but all solutions involves new problems... now my problem is with a function of this type: CREATE OR REPLACE FUNCTION public.rec_f_consultarplanificacionrubros (smallint, smallint, char(9),

Re: [SQL] case stement when null

2004-06-19 Thread V i s h a l Kashyap @ [Sai Hertz And Control Systems]
Dear Jaime , CREATE OR REPLACE FUNCTION public.rec_f_consultarplanificacionrubros (smallint, smallint, char(9), smallint, smallint, smallint, char(2)) RETURNS SETOF public.rec_td_rubrosplanificados AS ' select rub_codigo, cpa_valor, cpa_fechavencimiento from rec_m_cuadropagosciclo

Re: [SQL] In 7.4 ensure you have DEFAULT now () with no spaces

2004-06-19 Thread Peter Eisentraut
David B wrote: We had been testing 7.4 for a few days and just noticed that some tables had created_timestamp rows with a date/time of the date the DB was created...not the date/time the insert was done. Looking at those tables the create DDL's for those few tables contained now () as in:

Re: [SQL] plpgsql - Insert from a record variable?

2004-06-19 Thread Tom Lane
Riccardo G. Facchini [EMAIL PROTECTED] writes: --- Phil Endecott __ wrote: I'm writing a simple plpgsql function that selects a row from a table, modifies it slightly, and inserts the modified version. This sounds simple, but I can't find how to do the insert in a simple generic fashion:

Re: [SQL] In 7.4 ensure you have DEFAULT now () with no spaces

2004-06-19 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes: David B wrote: Looking at those tables the create DDL's for those few tables contained now () as in: created_timestamp timestamp DEFAULT now () -- note the space between now and () Whatever it was, that was not the problem. With 7.4.1: