Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Admin > column: on upda...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 4962 of 5124
Post > Topic >>

column: on update update?

by michael.monnerie@[EMAIL PROTECTED] (Michael Monnerie) May 7, 2008 at 10:50 AM

--nextPart1641173.eaYQIj4IYg
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi, I fear this is a beginners question but I'm no SQL guru and
couldn't=20
find it out of the documentation.

=46or SpamAssassin, I have a table "awl" (auto white list), and there=20
should be one field "lastupdate". I added it like this:
ALTER TABLE awl add column lastupdate timestamp default now();

But I also need the "lastupdate" be updated every time a field in that=20
row is updated, so a statement like this:

ALTER TABLE awl add column lastupdate2 timestamp default now() on
update=20
set now();

But it doesn't work. Do I need a trigger? If yes, what would be the=20
format? I never did triggers.

mfg zmi
=2D-=20
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0676/846 914 666                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc
| gpg --im****t"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: www.keyserver.net                   Key-ID: 1C1209B4

--nextPart1641173.eaYQIj4IYg
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQBIIW1hzhSR9xwSCbQRAhXeAJ0RJXQFteNDOy6cBm2jcLGXlZDaBACfYVRe
qCZBVzOFzQv7dzK8hH/VzOI=
=1mHq
-----END PGP SIGNATURE-----

--nextPart1641173.eaYQIj4IYg--
 




 6 Posts in Topic:
column: on update update?
michael.monnerie@[EMAIL P  2008-05-07 10:50:41 
Re: column: on update update?
richard.broersma@[EMAIL P  2008-05-07 06:23:04 
Re: column: on update update?
michael.monnerie@[EMAIL P  2008-05-07 16:49:03 
Re: column: on update update?
gergely.czuczy@[EMAIL PRO  2008-05-07 16:52:26 
Re: column: on update update?
tgl@[EMAIL PROTECTED] (T  2008-05-07 11:27:54 
Re: column: on update update? [solved]
michael.monnerie@[EMAIL P  2008-05-08 09:41:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 1:10:22 CDT 2008.