Search Postgresql Archives

How can I tell, in a trigger, if a value in a string is an integer.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a trigger function that, for every Update or Insert of
a table inserts a row in a "audit" table that contains some trace
data, the key of the first table and the changed columns (unchanged
cols are NULL) I have this working with a plpgsql function execpt
for one of the trace fields (called the audit_session) which is an 
integer. The value of this should be -1 unless a variable is set
for the session using 

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

which can be read with 

current_setting('session.sessionid')

Which will allow the web server to link a action to a "session"
(data stored in another table but starts from 1 and goes up as 
a integer)

I was not able to make the trigger function work in plperl (where
the forcing of the invalid, unset, or unknown to -1 would be easy).

any ideas on the best way to handle this.

-- 
This email, and any files transmitted with it, is confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed.  If you have received this email in error, 
please advise postmaster@xxxxxxxxxxx <mailto:postmaster@xxxxxxxxxxx>.

New MDT Software Headquarters (As of July 1, 2008):
3480 Preston Ridge Road
Suite 450
Alpharetta, GA 30005


Philip W. Dalrymple III <pwd@xxxxxxxxxxx>
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux