Re: can I update multiple table at a time?

From: "Igor Neyman" <ineyman(at)perceptron(dot)com>
To: "Jagadeesh" <mnjagadeesh(at)gmail(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: can I update multiple table at a time?
Date: 2008-10-10 13:18:29
Message-ID: F4C27E77F7A33E4CA98C19A9DC6722A20390A11A@EXCHANGE.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Jagadeesh
Sent: Friday, October 10, 2008 1:12 AM
To: pgsql-admin(at)postgresql(dot)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(at)postgresql(dot)org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2008-10-10 14:00:52 Re: problem running uui.sql script OSSP-UUID package
Previous Message jordi.tablada 2008-10-10 13:04:29 Re: problem running uui.sql script OSSP-UUID package