Re: can I update multiple table at a time?

Поиск
Список
Период
Сортировка
От Igor Neyman
Тема Re: can I update multiple table at a time?
Дата
Msg-id F4C27E77F7A33E4CA98C19A9DC6722A20390A11A@EXCHANGE.corp.perceptron.com
обсуждение исходный текст
Ответ на can I update multiple table at a time?  (Jagadeesh <mnjagadeesh@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: jordi.tablada@hyds.es
Дата:
Сообщение: Re: problem running uui.sql script OSSP-UUID package
Следующее
От: Tom Lane
Дата:
Сообщение: Re: problem running uui.sql script OSSP-UUID package