Postgres has some problems with the unit code. WIthout getting into personal preferences with code indentation (eye rolls) I would like to point out that (at least on windows) reading res after pqclear(res) will result in a SIGFAULT error.
So inspecting pqconnection.Execute(...)
res := pqexec(tr.PGConn,pchar(s));
if (PQresultStatus(res) in [PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
begin
pqclear(res);
<snip>
if not (PQresultStatus(res) in [PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
begin
s := PQerrorMessage(tr.PGConn);I'm consistently getting a SIGFAULT error unless I set res to nil and change the following
res := pqexec(tr.PGConn,pchar(s));
if (PQresultStatus(res) in [PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
begin
pqclear(res);
res:=nil;
<snip>
if (resnil) and not (PQresultStatus(res) in
[PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
begin
s := PQerrorMessage(tr.PGConn);Can someome please review pqconnection.pp and fix this? I'm having to re-apply my fix every time I update and my bug report is going unheeded. Which is crippling my ability to even use Postgres.
Please, fix soon :-)
