Re: libpq analog of \c - Mailing list pgsql-general

From Laurenz Albe
Subject Re: libpq analog of \c
Date
Msg-id 65b18907e04e181eca7166e49bfa48314d6d31d3.camel@cybertec.at
Whole thread
In response to libpq analog of \c  (Igor Korot <ikorot01@gmail.com>)
Responses Re: libpq analog of \c
List pgsql-general
On Sun, 2026-10-04 at 23:09 -0700, Igor Korot wrote:
> What do  issue in the libpq interface to
> select the current database?

You cannot select the current database.  A database connection remains
connected to the same database for the entire time of the connection.
You'll have to do what psql does: connect to the second database, and
if that succeeds, disconnect from the first one.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: libpq analog of \c
Next
From: "Carl.Weierstrass"
Date:
Subject: bug or feature