Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Unloading a tab...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 15443 of 16112
Post > Topic >>

Unloading a table consistently

by xof@[EMAIL PROTECTED] (Christophe) May 3, 2008 at 09:11 AM

Hi,

I will have a log table which, once a day or so, is copied to a file  
(for movement to a data warehouse), and the log table emptied.  For  
performance, the log table on the production system has no indexes,  
and is write-only.  (The unload process is the only reader.)

To unload it, I will be doing:

BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
COPY log TO 'filename-path';
TRUNCATE log;
COMMIT;

My understanding is that I need the SERIALIZABLE isolation level so  
that the COPY and TRUNCATE see exactly the same view of the table.   
Obviously, I don't want to lose data by having the TRUNCATE delete  
records that appeared while the COPY was executing.  Is that  
correct?  Is there a better way to handle this kind of thing that I'm  
missing?

Thanks!
-- Xof

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




 6 Posts in Topic:
Unloading a table consistently
xof@[EMAIL PROTECTED] (C  2008-05-03 09:11:16 
Re: Unloading a table consistently
tgl@[EMAIL PROTECTED] (T  2008-05-03 12:56:57 
Re: Unloading a table consistently
xof@[EMAIL PROTECTED] (C  2008-05-03 10:24:36 
Re: Unloading a table consistently
ptjm@[EMAIL PROTECTED] (  2008-05-03 23:29:11 
Re: Unloading a table consistently
craig@[EMAIL PROTECTED]   2008-05-04 23:28:16 
Re: Unloading a table consistently
xof@[EMAIL PROTECTED] (C  2008-05-04 12:07:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 20 4:08:54 CDT 2008.