Re: How can I tell, in a trigger, if a value in a string is an integer. - Mailing list pgsql-general

From Tomasz Myrta
Subject Re: How can I tell, in a trigger, if a value in a string is an integer.
Date
Msg-id ge9u8q$15ll$1@news.hub.org
Whole thread Raw
In response to How can I tell, in a trigger, if a value in a string is an integer.  ("Philip W. Dalrymple" <pwd@mdtsoft.com>)
List pgsql-general
Philip W. Dalrymple napisal 29.10.2008 15:26:

>  set_config('session.sessionid','23',false);

I validate strings with regexp. This expression returns true:

select '23' ~'^-{0,1}[0-9]+$';

If it's true - you can cast it safely:
select cast('23' as integer)

--
Regards,
Tomasz Myrta

pgsql-general by date:

Previous
From: 小波 顾
Date:
Subject: Re: Are there plans to add data compression feature to postgresql?
Next
From: "Grzegorz Jaśkiewicz"
Date:
Subject: Re: Are there plans to add data compression feature to postgresql?