libpq

Started by Dmitriy Igrishinover 15 years ago3 messages
#1Dmitriy Igrishin
dmitigr@gmail.com

Hey all,

Is it guaranteed that functions, which accept PGconn* properly
works if PGconn* is NULL (or just 0) and returns in such cases
the same values as for not-NULL PGconn* ?
If so, I think it should be documented ?!

Regards,
Dmitriy

#2Dmitriy Igrishin
dmitigr@gmail.com
In reply to: Dmitriy Igrishin (#1)

Hey all,

Is it guaranteed that functions, which accept PGconn* (PGresult*)
properly works if PGconn* (PGresult*) is NULL or is it better to check
on NULL the value of the pointer before calling those functions?

Regards,
Dmitriy

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dmitriy Igrishin (#2)
Re: libpq

Dmitriy Igrishin <dmitigr@gmail.com> writes:

Is it guaranteed that functions, which accept PGconn* (PGresult*)
properly works if PGconn* (PGresult*) is NULL or is it better to check
on NULL the value of the pointer before calling those functions?

I think they all do check for NULL, but whether they give back a default
result that's useful for you is harder to say.

regards, tom lane