Re: [GENERAL] Lifetime of PQexecPrepared() returned value - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Lifetime of PQexecPrepared() returned value
Date
Msg-id 6665.1501957803@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Lifetime of PQexecPrepared() returned value  (Igor Korot <ikorot01@gmail.com>)
List pgsql-general
Igor Korot <ikorot01@gmail.com> writes:
> However it leads to another question - should PQclear set the pointer to NULL?

C doesn't provide any reasonable way to do that.  The argument of PQclear
needn't even be an lvalue; for example, if you're not too concerned about
error checking, it's not unreasonable to write

    PQclear(PQexec(conn, "some SQL command"));

            regards, tom lane


pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Re: [GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n
Next
From: "Dan Cooperstock at Software4Nonprofits"
Date:
Subject: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)