Postgresql-module doesn't return error
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3107
Reported by Petter Larsson petterl@home.se
When you get an error in a Postgresql big_query(), the only error returned is:
Error in frontend-backkend communications and a backtrace.
It would be more interesting to get the error from Postgresql, which will tell you what went wrong.
A patch like below should fix that:
Index: postgres.c
===================================================================
RCS file: /cvs/Pike/7.3/src/modules/Postgres/postgres.c,v
retrieving revision 1.25
diff -r1.25 postgres.c
431a432,433
> char *err;
>
500a503
> err = PQresultErrorMessage(res);
502c505
< Pike_error ("Error in frontend-backend
communications.\n");
---
> Pike_error ("Postgresql error: %s",err);