Re: Deleting prepared statements from libpq. - Mailing list pgsql-hackers

From Jelte Fennema
Subject Re: Deleting prepared statements from libpq.
Date
Msg-id CAGECzQRXFdZkyxjOTKSER8140ioq5c1HZUURxozC8n_yR9WauQ@mail.gmail.com
Whole thread Raw
In response to Re: Deleting prepared statements from libpq.  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Mon, 19 Jun 2023 at 04:52, jian he <jian.universality@gmail.com> wrote:
> > /* Now that it's closed we should get an error when describing */
> > res = PQdescribePortal(conn, "cursor_one");
> > if (PQresultStatus(res) != PGRES_FATAL_ERROR)
> > pg_fatal("expected COMMAND_OK, got %s", PQresStatus(PQresultStatus(res)));
> should it be "if (PQresultStatus(res) == PGRES_FATAL_ERROR)" ?

The check is correct, but the fatal message was incorrect here. We're
intentionally expecting an error here, because that's the easiest way
to see that the portal was closed.



pgsql-hackers by date:

Previous
From: Jelte Fennema
Date:
Subject: Re: Deleting prepared statements from libpq.
Next
From: Andrey M. Borodin
Date:
Subject: Re: Bypassing shared_buffers