[SQL] Missing SELECT INTO ... DEFAULT VALUES in plpgsql for composite t ypes

2004-11-22 Thread Passynkov, Vadim
Hi all Just self-explanatory code below -- var1 with default value. CREATE DOMAIN var1_type AS pg_catalog.text DEFAULT 'udp'::pg_catalog.text CONSTRAINT "var1_const" CHECK ( VALUE IS NOT NULL AND ( VALUE = 'tcp'::pg_catalog.text OR VALUE = 'udp'::pg_catalog.text ) ); -- var2 without defaul

Re: [SQL] get sequence value of insert command

2004-11-22 Thread Passynkov, Vadim
> > > create sequence mysequence; > > > > > > create table foo( > > > id integer default nextval('mysequence'), > > > bla text, > > > wombat integer, > > > foobar date, > > > primary key(id) > > > ); > > > > > > insert into foo (wombat) values (88); > > > > > > now how do i know the id

Re: [SQL] get sequence value of insert command

2004-11-19 Thread Passynkov, Vadim
> -Original Message- > From: Erik Thiele [mailto:[EMAIL PROTECTED] > Sent: Friday, November 19, 2004 3:42 AM > To: [EMAIL PROTECTED] > Subject: [SQL] get sequence value of insert command > > > hi > > create sequence mysequence; > > create table foo( > id integer default nextval('mys

Re: [SQL] Isnumeric function?

2004-09-09 Thread Passynkov, Vadim
How about this CREATE OR REPLACE FUNCTION is_numeric ( text ) RETURNS bool AS ' if { [string is integer $1] || [string is double $1] } { return true } return false ' LANGUAGE 'pltcl' IMMUTABLE; SELECT is_numeric ( '-1' ); is_numeric t (1 row) SELECT is_numeric ( '+1e-1'