Skip site navigation (1) Skip section navigation (2)

Re: does update of column with no relation imply a relation check of other column?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Greg Jaskiewicz <gryzman(at)gmail(dot)com>, Anibal David Acosta <aa(at)devshock(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: does update of column with no relation imply a relation check of other column?
Date: 2011-10-31 19:55:35
Message-ID: 7564.1320090935@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Wed, Oct 19, 2011 at 12:42 PM, Greg Jaskiewicz <gryzman(at)gmail(dot)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

In response to

pgsql-performance by date

Next:From: Mohamed HashimDate: 2011-11-01 03:03:51
Subject: Re: Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!
Previous:From: Tom LaneDate: 2011-10-31 18:59:19
Subject: Re: Composite keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group