pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpq PQexecPrepared returns NULL
4+ messages / 2 participants
[nested] [flat]

* libpq PQexecPrepared returns NULL
@ 2004-03-04 12:07 Gergely Czuczy <phoemix@harmless.hu>
  2004-03-04 14:59 ` Re: libpq PQexecPrepared returns NULL Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Gergely Czuczy @ 2004-03-04 12:07 UTC (permalink / raw)
  To: pgsql-interfaces

hello,

i've got a very strange problem, PQexecPrepared returns NULL, but if i
immadietly rerun the query it will run normally, returning the query
result. what can be the problem, and how could I track it down, solve it?

any suggestions welcome

bye,

Gergely Czuczy
mailto: phoemix@harmless.hu
PGP: http://phoemix.harmless.hu/phoemix.pgp

The point is, that geeks are not necessarily the outcasts
society often believes they are. The fact is that society
isn't cool enough to be included in our activities.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: libpq PQexecPrepared returns NULL
  2004-03-04 12:07 libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
@ 2004-03-04 14:59 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-03-04 15:03   ` Re: libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2004-03-04 14:59 UTC (permalink / raw)
  To: Gergely Czuczy <phoemix@harmless.hu>; +Cc: pgsql-interfaces

Gergely Czuczy <phoemix@harmless.hu> writes:
> i've got a very strange problem, PQexecPrepared returns NULL, but if i
> immadietly rerun the query it will run normally, returning the query
> result. what can be the problem, and how could I track it down, solve it?

Check PQerrorMessage().

AFAIR the only reasons for a null result (instead of a possibly-error
PGresult) would be out-of-memory or connection failure.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: libpq PQexecPrepared returns NULL
  2004-03-04 12:07 libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
  2004-03-04 14:59 ` Re: libpq PQexecPrepared returns NULL Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-03-04 15:03   ` Gergely Czuczy <phoemix@harmless.hu>
  2004-03-04 15:18     ` Re: libpq PQexecPrepared returns NULL Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Gergely Czuczy @ 2004-03-04 15:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces

hello

the strange thing is -- what i've forgot to mention -- is that
PQerrorMessage returns an empty string, so from this i don't know the
source of the error.

how can I check if it is _really_ out of memory?
i have 1G RAM in the box, and shm values are set:
kernel.shmmax = 536870912
kernel.shmall = 536870912

Bye,

Gergely Czuczy
mailto: phoemix@harmless.hu
PGP: http://phoemix.harmless.hu/phoemix.pgp

The point is, that geeks are not necessarily the outcasts
society often believes they are. The fact is that society
isn't cool enough to be included in our activities.

On Thu, 4 Mar 2004, Tom Lane wrote:

> Gergely Czuczy <phoemix@harmless.hu> writes:
> > i've got a very strange problem, PQexecPrepared returns NULL, but if i
> > immadietly rerun the query it will run normally, returning the query
> > result. what can be the problem, and how could I track it down, solve it?
>
> Check PQerrorMessage().
>
> AFAIR the only reasons for a null result (instead of a possibly-error
> PGresult) would be out-of-memory or connection failure.
>
> 			regards, tom lane
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: libpq PQexecPrepared returns NULL
  2004-03-04 12:07 libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
  2004-03-04 14:59 ` Re: libpq PQexecPrepared returns NULL Tom Lane <tgl@sss.pgh.pa.us>
  2004-03-04 15:03   ` Re: libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
@ 2004-03-04 15:18     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2004-03-04 15:18 UTC (permalink / raw)
  To: Gergely Czuczy <phoemix@harmless.hu>; +Cc: pgsql-interfaces

Gergely Czuczy <phoemix@harmless.hu> writes:
> the strange thing is -- what i've forgot to mention -- is that
> PQerrorMessage returns an empty string, so from this i don't know the
> source of the error.

That's messy.  I'd recommend getting out a debugger and tracing through
it to see exactly where it's failing.  Or put in some printf's.  There
aren't that many paths that could return NULL.  I guess one of them must
be forgetting to set PQerrorMessage, which seems like a bug to me.  Let
us know what you find out.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-03-04 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-04 12:07 libpq PQexecPrepared returns NULL Gergely Czuczy <phoemix@harmless.hu>
2004-03-04 14:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-03-04 15:03   ` Gergely Czuczy <phoemix@harmless.hu>
2004-03-04 15:18     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox