Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A2BB01B505EB for ; Wed, 14 Mar 2012 07:55:13 -0300 (ADT) Received: from woodbine.london.02.net ([87.194.255.145]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S7lrK-0006BI-Qj for pgsql-admin@postgresql.org; Wed, 14 Mar 2012 10:55:12 +0000 Received: from lenin.edesix.com (93.97.174.104) by woodbine.london.02.net (8.5.140) id 4EEB64740588A5E6 for pgsql-admin@postgresql.org; Wed, 14 Mar 2012 10:54:56 +0000 Received: from elliot.edesix.com ([192.168.1.51]) by lenin.edesix.com with esmtps (SSLv3:CAMELLIA256-SHA:256) (Exim 4.76) (envelope-from ) id 1S7lr5-000486-UD for pgsql-admin@postgresql.org; Wed, 14 Mar 2012 10:54:56 +0000 Message-ID: <1331722455.5503.166.camel@elliot> Subject: Re: Update actions (with user name) inside PostgreSQL DB - any version on postgreSQL From: Robin Iddon To: pgsql-admin@postgresql.org Date: Wed, 14 Mar 2012 10:54:15 +0000 In-Reply-To: <8ecc4155e8754edef35e260a60a4a8db@mail.gmail.com> References: <8ecc4155e8754edef35e260a60a4a8db@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2 (3.2.2-1.fc16) Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Spam-Score: -21.9 (---------------------) X-Spam-Report: lenin.edesix.com has assigned spam score: -21.9 / 5.0 pts rule name description ---- ---------------------- -------------------------------------------------- -20 ALL_TRUSTED Passed through trusted hosts only via SMTP -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/77 X-Sequence-Number: 39265 What do you want to have happen to the timestamp/user? You can obviously do: update test set t4 =3D 9, user =3D , timestamp =3D where t1 =3D 001; I'm assuming you're trying to store the user and timestamp somewhere else, though? Robin On Wed, 2012-03-14 at 12:44 +0200, Khangelani Gama wrote: > =20 >=20 > Hi >=20 > =20 >=20 > =20 >=20 > Is it possible to have an update query that will specify actions, > timestamp, user who=E2=80=99s making the update inside the database. Can = this > be done without any script but just in the transaction block=20 >=20 > =20 >=20 > Example: >=20 > =20 >=20 > dbtest=3D# UPDATE table test set t4 =3D 9 where t1 =3D 001 then specify > user_name, timestamp() ; >=20 > =20 >=20 > =20 >=20 > =20 >=20 > =20 >=20 > Thanks in advance >=20 > =20 >=20 > =20 >=20 > =20 >=20 > =20 >=20 > =20 >=20 > =20 >=20 > C O N F I D E N T I A L I T Y N O T I C E=20 > The contents of and attachments to this e-mail are intended for the > addressee only, and may contain the confidential information of > Argility (Proprietary) Limited and/or its subsidiaries. Any review, > use or dissemination thereof by anyone other than the intended > addressee is prohibited. If you are not the intended addressee please > notify the writer immediately and destroy the e-mail. Argility > (Proprietary) Limited and its subsidiaries distance themselves from > and accept no liability for unauthorised use of their e-mail > facilities or e-mails sent other than strictly for business purposes. >=20 > =20 >=20 >=20 >=20 >=20 >=20 > CONFIDENTIALITY NOTICE > The contents of and attachments to this e-mail are intended for the addre= ssee only, and may contain the confidential information of Argility (Propri= etary) Limited and/or its subsidiaries. Any review, use or dissemination th= ereof by anyone other than the intended addressee is prohibited. > If you are not the intended addressee please notify the writer immediatel= y and destroy the e-mail. Argility (Proprietary) Limited and its subsidiari= es distance themselves from and accept no liability for unauthorised use of= their e-mail facilities or e-mails sent other than strictly for business p= urposes.