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
> > > 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
> -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
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'