Re: can I update multiple table at a time? - Mailing list pgsql-admin

From Igor Neyman
Subject Re: can I update multiple table at a time?
Date
Msg-id F4C27E77F7A33E4CA98C19A9DC6722A20390A11A@EXCHANGE.corp.perceptron.com
Whole thread Raw
In response to can I update multiple table at a time?  (Jagadeesh <mnjagadeesh@gmail.com>)
List pgsql-admin
If you could declare a Foreign Key on two columns in "history" table
referencing "master" table, and declare this FK with "ON UPDATE CASCADE"
option, then postgres will update status in history table for you
whenever you update status in master table.

Igor

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Jagadeesh
Sent: Friday, October 10, 2008 1:12 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] can I update multiple table at a time?

Hello Gurus,

Is it possible to update two table using single sql statement? huh?
let me be clear

I have table master with state and date field. And in history table I
have same fields i.e., state and date. I'm writing an update statement
to set 'open' state records  to 'closed' state after 7. both table can
be joined using id.

Any thoughts?

Thanks

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


pgsql-admin by date:

Previous
From: jordi.tablada@hyds.es
Date:
Subject: Re: problem running uui.sql script OSSP-UUID package
Next
From: Tom Lane
Date:
Subject: Re: problem running uui.sql script OSSP-UUID package