Comments follow.<br><br><div class="gmail_quote">2009/10/14 Joost van der Sluis <span dir="ltr"><<a href="mailto:joost@cnoc.nl">joost@cnoc.nl</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, 2009-10-13 at 17:50 -0300, Alexsander Rosa wrote:<br>
> It's weird to *require* a COMMIT on a simple SELECT,<br>
<br>
</div>That's not strange. You can't even access Postgres (at any way) without<br>
a transaction. So you always have to start and end the transaction.<br></blockquote><div> </div><div>I would disagree -- it's possible to access PostgreSQL without a transaction. I've been using libpq for ages, accessing directly from C/C++ code and starting transactions only for I/U/D commands.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
> but the CommitRetaining trick seemed to work. The system table<br>
> "pg_stat_activity" still shows the "<IDLE> in transaction" pending<br>
<br>
</div>That's because a new transaction is started immediately by<br>
CommitRetaining.<br></blockquote><div><br>Ok.<br></div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
> query but the lock is no more -- at least I could execute a CREATE<br>
> TABLE normally.<br>
<br>
</div>What you should really do is to set the right transaction isolation<br>
level.<font color="#888888"><br></font></blockquote><div><br>Postgresql has only two isolation levels, and i'm using the default "read commited" level. There's no "read uncommited" level, as the other one is "serializable" that would only make things worst. I think we should not *require" a transaction for every command -- the programmer should be able to choose when to use them. <br>
</div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font color="#888888">
Joost<br>
</font><div><div></div><div class="h5"><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Atenciosamente,<br>Alexsander da Rosa<br>Linux User #113925<br><br>"Extremismo na defesa da liberdade não é defeito.<br>Moderação na busca por justiça não é virtude."<br>
-- Barry Goldwater<br>