Search Postgresql Archives

Re: Bulk processing & deletion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Unlogged tables can't be temporary.

2011/10/13, Ivan Voras <ivoras@xxxxxxxxxxx>:
> On 13/10/2011 14:34, Alban Hertroys wrote:
>
>>> Any other ideas?
>>
>> CREATE TABLE to_delete (
>>   job_created timestamp NOT NULL DEFAULT now(),
>>   fk_id int NOT NULL
>> );
>>
>> -- Mark for deletion
>> INSERT INTO to_delete (fk_id) SELECT id FROM table WHERE condition = true;
>>
>> -- Process in app
>> SELECT table.* FROM table INNER JOIN to_delete ON (table.id =
>> to_delete.fk_id);
>>
>> -- Delete them
>> DELETE FROM table WHERE id IN (SELECT fk_id FROM to_delete);
>
> Good point. I can even use a temp table for this and make use of
> UNLOGGED temp tables when we upgrade to 9.1!
>
>
>


-- 
------------
pasman

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux