change database

From: Florian Chis <florian(dot)chis(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: change database
Date: 2009-07-15 08:36:34
Message-ID: 32f81f010907150136v424672a4m2db78b98fac13482@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

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.

So what are my options?

With thanks,
Florian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rafael Martinez 2009-07-15 12:13:34 pg_stat_reset() not resetting all statistics counters
Previous Message Thomas Kellerer 2009-07-15 06:41:46 Re: problem with pg_restore?