Re: change database - Mailing list pgsql-general

From Bill Moran
Subject Re: change database
Date
Msg-id 20090715142542.0cb70887.wmoran@potentialtech.com
Whole thread Raw
In response to change database  (Florian Chis <florian.chis@gmail.com>)
Responses Re: change database
List pgsql-general
In response to Florian Chis <florian.chis@gmail.com>:
>
> I'm working on a port from mysql to postgres. I have a function which
> connect's to the database, checks for database existance and creates it
> otherwise.
> The last thing it does it executes "use my_database" (mysql stuff). Now I'm
> trying to find something similar in postgres. I know that psql has \c but
> that dosen't help me with jdbc. I also know that the easy solution out of
> this is to close the connection and then open it again with /my_database in
> the URL but I want to avoid this.

Close the connection and reopen it.  There's no equivalent.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: savepoints in 8.3.7 or whatever...
Next
From: ANdreas Wenk
Date:
Subject: Re: Function does not exist