[SQL] Testing for null record in plpgsql

2008-04-10 Thread Erik Jones
Ok, let's say I have the following: CREATE TABLE foo ( val1 integer, val2 integer ); CREATE OR REPLACE FUNCTION returns_null_maybe() RETURNS foo AS $$ DECLARE res integer; BEGIN SELECT INTO res extract('month' from now()::integer % 2; IF r

Re: [DOCS] [HACKERS] [SQL] pl/PgSQL, variable names in NEW

2008-04-10 Thread Alvaro Herrera
Tom Lane wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: > > From what I can see on CPAN (unless I am missing something) DBD::PgSPI > > hasn't been updated since 2004 and is at version 0.2. > > Oh, if it's not a live project then that changes things entirely. > +1 for just dropping the ment

Re: [DOCS] [HACKERS] [SQL] pl/PgSQL, variable names in NEW

2008-04-10 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > From what I can see on CPAN (unless I am missing something) DBD::PgSPI > hasn't been updated since 2004 and is at version 0.2. Oh, if it's not a live project then that changes things entirely. +1 for just dropping the mention.

Re: [HACKERS] [SQL] pl/PgSQL, variable names in NEW

2008-04-10 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Question for plperl hackers: Should we remove the mention of DBD::PgSPI > from the PL/Perl manual? It seems like a reasonable suggestion to me, since perl database users probably already know DBD and don't have to learn something new if they go that wa

Re: [SQL] pl/PgSQL, variable names in NEW

2008-04-10 Thread Alvaro Herrera
Martin Edlman wrote: > |> I don't want to rewrite whole trigger to plPerl as I would have to use > |> DBD-PgSPI. > | > | Huh? Certainly not -- there are functions in PL/Perl for this. See > | spi_exec_query in > | http://www.postgresql.org/docs/8.3/static/plperl-database.html > > Oh, I see. I ha

Re: [SQL] dateformat issue

2008-04-10 Thread Volkan YAZICI
Hi, Gavin 'Beau' Baumanis <[EMAIL PROTECTED]> writes: > I have a question about dates, please. > > I am using Coldfusion and Postgres > I have a function that takes the ate entered in a form and converts it > into an odbc date format. > > So the string ends up being; > {d '2008-04-10'} > > Strange

Re: [SQL] pl/PgSQL, variable names in NEW

2008-04-10 Thread Martin Edlman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 |> I don't want to rewrite whole trigger to plPerl as I would have to use |> DBD-PgSPI. | | Huh? Certainly not -- there are functions in PL/Perl for this. See | spi_exec_query in | http://www.postgresql.org/docs/8.3/static/plperl-database.html Oh,

Re: [SQL] dateformat issue

2008-04-10 Thread Tk421
Gavin 'Beau' Baumanis escribió: Hi Everyone, I have a question about dates, please. I am using Coldfusion and Postgres I have a function that takes the ate entered in a form and converts it into an odbc date format. So the string ends up being; {d '2008-04-10'} Strangely, the function is us

Re: [SQL] dateformat issue

2008-04-10 Thread Aarni Ruuhimäki
On Thursday 10 April 2008 09:41, Gavin 'Beau' Baumanis wrote: > Hi Aarni, > > just so you know I am using the CF built-in function, > createodbcdate > > here is the info from livedocs. > > CreateODBCDate > Description > > Returns a date in ODBC date format. > Category > > Date and time functions >