The situation you describe is called a "phantom read", and is not possible when you use an isolation level that prevents this like REPEATABLE READ
or SERIALIZABLE
.
http://www.postgresql.org/docs/current/static/transaction-iso.html
You can change the isolation level using the SET TRANSACTION
command:
http://www.postgresql.org/docs/current/static/sql-set-transaction.html
Depending on the interface that you use to connect to the database you might also be able to use the corresponding API calls (e.g. Connection.setTransactionIsolation()
in Java/JDBC)