Dirty readings in Postgres

I have a long function that should insert new lines. How to check the progress of this function?

I thought that 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 you see pasted records while this long function still works?

thanks

+5
source share
2 answers

PostgreSQL does not implement a way to see this from outside a function, like READ UNCOMMITTEDthe isolation level. Your main two options:

+10

PostgreSQL

PostgreSQL . , Read Committed Serializable. Read Uncommitted, Read Committed, Repeatable Read, Serializable, , . SQL: , , , .

+6

All Articles