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

Re: Patches for TODO item: Avoid truncating empty OCDR temp tables on COMMIT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Cc: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patches for TODO item: Avoid truncating empty OCDR temp tables on COMMIT
Date: 2013-01-15 03:33:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com> writes:
> Please find attached two patches, implementing two different approaches to
> fix the issue of COMMIT truncating empty TEMP tables that have the ON

> v2.patch: This approach introduces a boolean 'rd_rows_inserted' in
> RelationData struct, and sets this struct to true for every TEMP table in
> which a row is inserted. During commit, we avoid truncating those OCDR temp
> tables that haven't been inserted into in this transaction.

I think this is unacceptable on its face.  It essentially supposes that
relcache entries are reliable storage.  They are not.  There are some
places where we rely on relcache entries preserving state information
for optimization purposes --- but in this case, discarding a relcache
entry would result in visibly incorrect behavior, not just some
performance loss.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Gurjeet SinghDate: 2013-01-15 03:47:58
Subject: Re: count(*) of zero rows returns 1
Previous:From: Tom LaneDate: 2013-01-15 03:26:39
Subject: Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body

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