Dirty Reads in Postgres

Posted by User1 on Stack Overflow See other posts from Stack Overflow or by User1
Published on 2009-07-22T13:54:34Z Indexed on 2010/05/25 8:41 UTC
Read the original article Hit count: 216

Filed under:

I have a long running function that should be inserting new rows. How do I check the progress of this function?

I was thinking dirty reads would work so I read http://www.postgresql.org/docs/8.4/interactive/sql-set-transaction.html and came up with the following code and ran it in a new session:


SET SESSION CHARACTERISTICS AS SERIALIZABLE;

SELECT * FROM MyTable;

Postgres gives me a syntax error. What am I doing wrong? If I do it right, will I see the inserted records while that long function is still running?

Thanks

© Stack Overflow or respective owner

Related posts about postgresql