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

Re: DELETE with JOIN

From: felix(at)crowfix(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: DELETE with JOIN
Date: 2008-08-07 21:35:46
Message-ID: 20080807213546.GA11185@crowfix.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Thu, Aug 07, 2008 at 04:01:29PM -0400, Frank Bax wrote:

> You mentioned that the process of insert/delete is to be repeated.  Are all 
> the rows that were inserted; the same ones that will be deleted when the 
> cycle is complete?  If yes; then after you delete this batch of rows; add a 
> 'junky' column and populate with any value different from the default.  
> Your mass-insert should populate with the default value; and you can delete 
> based on this value.

That would work, and might even be possible, but adding a column just
to mark test data doesn' quite sit right.  This data is, yucch, tax
data, and I have been generating test cases with bogus country names,
like Fredonia -- the taxes themselves are in a dozen tables with
foreign key references holding them together, one of them being the
country name.  I was sort of doing what you suggest by using bogus
country names, but that's only indirect.  To add a column to every
concerned table would be a pain for other reasons.

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix(at)crowfix(dot)com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

In response to

pgsql-sql by date

Next:From: Yura GalDate: 2008-08-07 21:37:41
Subject: Re: enumerate groups given a certain value
Previous:From: Mark RobertsDate: 2008-08-07 20:27:00
Subject: Re: DELETE with JOIN

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