Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread pasman pasmański
Unlogged tables can't be temporary. 2011/10/13, Ivan Voras : > 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_i

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Ivan Voras
On 13 October 2011 20:08, Steve Crawford wrote: > On 10/13/2011 05:20 AM, Ivan Voras wrote: >> >> Hello, >> >> I have a table with a large number of records (millions), on which the >> following should be performed: >> >>        1. Retrieve a set of records by a SELECT query with a WHERE >> condit

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Steve Crawford
On 10/13/2011 05:20 AM, Ivan Voras wrote: Hello, I have a table with a large number of records (millions), on which the following should be performed: 1. Retrieve a set of records by a SELECT query with a WHERE condition 2. Process these in the application 3. Delete them

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Alexander Pyhalov
On 10/13/2011 16:20, Ivan Voras wrote: Hello, I have a table with a large number of records (millions), on which the following should be performed: 1. Retrieve a set of records by a SELECT query with a WHERE condition 2. Process these in the application 3. Delete them fr

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Ivan Voras
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 >

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Gregg Jaskiewicz
If you don't need the data for more then a transaction, or connection length - use temporary tables to store ids of data you need to delete. If those change, or move, or something - it means you are missing PK on that table. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread Alban Hertroys
On 13 October 2011 14:20, Ivan Voras wrote: > Hello, > > I have a table with a large number of records (millions), on which the > following should be performed: > >        1. Retrieve a set of records by a SELECT query with a WHERE condition >        2. Process these in the application >        3.

[GENERAL] Bulk processing & deletion

2011-10-13 Thread Ivan Voras
Hello, I have a table with a large number of records (millions), on which the following should be performed: 1. Retrieve a set of records by a SELECT query with a WHERE condition 2. Process these in the application 3. Delete them from the table Now, in the default read-co