Re: [ADMIN] transaction_timestamp()

2010-05-24 Thread Samuel Stearns
Thanks, Tom. I read it again. I got into trouble using now() before. Transaction_timestamp() is really what I need, I think. I have a table that is updated multiple times/second. My archiving command operation: BEGIN; INSERT INTO blah_archive (id, user) SELECT id, user FROM blah where date <

Re: [ADMIN] transaction_timestamp()

2010-05-24 Thread Tom Lane
Samuel Stearns writes: > I have an archiving script running in an 8.3 environment using > transaction_timestamp() for the INSERT and DELETE operations. I want to run > the same thing in an 8.1 environment but transaction_timestamp() does not > exist in 8.1. now() will not work because of the

[ADMIN] transaction_timestamp()

2010-05-24 Thread Samuel Stearns
Howdy, I have an archiving script running in an 8.3 environment using transaction_timestamp() for the INSERT and DELETE operations. I want to run the same thing in an 8.1 environment but transaction_timestamp() does not exist in 8.1. now() will not work because of the time that elapses betwee

Re: [ADMIN] could not truncate directory "pg_subtrans": apparent wraparound

2010-05-24 Thread Simon Riggs
On Mon, 2010-05-24 at 08:46 +0300, Mikko Partio wrote: > It was freshly initdb'd with beta1 binaries, the contents were loded > from a pg_dump file. The number of transactions is very small, we're > talking about thousands (not billions). This database is the master of > a hot standby installation

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Josi Perez (3T Systems)
Thank you. The trigger: CREATE OR REPLACE FUNCTION logdata() RETURNS trigger AS $BODY$DECLARE arg_table varchar; arg_id varchar; arg_oldinteger; qrytext; BEGIN arg_table := TG_ARGV[0]; arg_id:= TG_ARGV[1];--field to use OLD.id arg_old := TG_ARGV[2]; --va

Fw: [ADMIN] Problems whit role and privileges

2010-05-24 Thread Eduardo Sá dos Reis
Hi Tom, I agree with you about the default permissions for the public schema. I do not understand is why the Dependencies tab (in pgAdmin III) of public schema displays all the roles (admweb, usuweb, admsfar, ususfar) Example: Dependencies tab Type Name Restriction Role admweb ACL Role usuweb

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Alex Hunsaker
On Wed, May 19, 2010 at 06:30, Josi Perez (3T Systems) wrote: > To avoid to delete registers I created one trigger activated "before delete" > with lines like that: > UPDATE tableX  set dtExc = 'now', userExc = current_user where idTableX = > OLD.idTableX; > return NULL; > > but, I need do the sam

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Szymon Guz
2010/5/24 Josi Perez (3T Systems) > Sorry for the inconvenience, but no one have ideas to solve this problem? > Am I in the wrong list to ask this? > Need I create triggers for each table? > > Thanks in advance for any suggestions. > Josi Perez > > 2010/5/19 Josi Perez (3T Systems) > > To avoid

Re: [ADMIN] Trigger with dynamic SQL

2010-05-24 Thread Josi Perez (3T Systems)
Sorry for the inconvenience, but no one have ideas to solve this problem? Am I in the wrong list to ask this? Need I create triggers for each table? Thanks in advance for any suggestions. Josi Perez 2010/5/19 Josi Perez (3T Systems) > To avoid to delete registers I created one trigger activated

Fw: [ADMIN] Problems whit role and privileges

2010-05-24 Thread Eduardo Sá dos Reis
Hi Tom, I agree with you about the default permissions for the public schema. I do not understand is why the Dependencies tab (in pgAdmin III) of public schema displays all the roles (admweb, usuweb, admsfar, ususfar) Example: Dependencies tab Type Name Restriction Role admweb ACL Role usuweb