From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Greg Jaskiewicz <gryzman@gmail.com>
Cc: Anibal David Acosta <aa@devshock.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: does update of column with no relation imply a relation check of other column?
Date: Mon, 31 Oct 2011 15:55:35 -0400
Message-ID: <7564.1320090935@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaVauvUbTfmBR-U7FFu9KH5QF5wC+T=hDvw6k3L6tktLg@mail.gmail.com>
References: <00ce01cc8e76$ed533480$c7f99d80$@devshock.com>
<C713AEF7-7E18-4B0C-8420-213C1B278F94@gmail.com>
<CA+TgmoaVauvUbTfmBR-U7FFu9KH5QF5wC+T=hDvw6k3L6tktLg@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Oct 19, 2011 at 12:42 PM, Greg Jaskiewicz <gryzman@gmail.com> wrote:
>> When I do an insert on table B, the database check if value for column
>> table_a_id exists in table A
>> But, if I do an update of column address of table B, does the database
>> check again?
> I just tested this, and it seems not.
It will not, unless you update the same row more than once in a single
transaction. If you do that, it no longer has enough information to be
sure the referencing value hasn't changed in that transaction, so it
will do a check.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, gryzman@gmail.com, aa@devshock.com
Subject: Re: does update of column with no relation imply a relation check of other column?
In-Reply-To: <7564.1320090935@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox