vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| But even that alternate template database would need to be created the first time after server installation by connceting to the template1 DB?? Right?? All I want is to automate database creation the first time after server installation eliminate user inputs -----Original Message----- From: Kris Jurka [mailto:books@ejurka.com] Sent: Monday, July 04, 2005 3:01 PM To: Nidhi Srivastava Cc: Thomas Dudziak; pgsql-jdbc@postgresql.org; John R Pierce Subject: Re: [JDBC] Create Database using JDBC On Mon, 4 Jul 2005, Nidhi Srivastava wrote: > Even when I'm not accessing templte1 but any other scratch database > through pgAdmin and try to create a new DB using JDBC I get the same > ERROR: CREATE DATABASE: source database "template1" is being accessed > by other users. Is there a way to check if a DB exists and create it if > it doesn't using JDBC. How can I ensure that pgAdmin is not open on any > of the client machines and connected to the Postgre server on my > machine....becuase if even a single pgAdmin client is open on any of the > client machines it doesn't allow me to create a new DB throwing the > above error. > I would suggest using an alernate template database to create new databases with. You could even mark it to refuse connections to ensure no one else will connect to it and block your operation. Kris Jurka ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster |
| |||
| Hi, Thomas, Thomas Dudziak schrieb: > But why then not requiring that no one is connected to the template1 > database ? That shouldn't be too much of a requirement. Myself, I > develop with postgres on a daily basis (using JDBC), and even I have > pgAmin only open when necessary eg. for checking that some data was > inserted in the db or testing a query. This will not be possible on installations with a large userbase, you have a bunch of users, admins and developers which are using all kinds of programs that (partially implicitly) connect to template1. Maybe the debian way (add an additional postgresql database for this purposes) should be adopted? Markus ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| ||||
| Hi, Nidhi, Nidhi Srivastava schrieb: > But even that alternate template database would need to be created the > first time after server installation by connceting to the template1 DB?? > Right?? No, you can specify any database that has no active connections (exept possibly your own single one) as template on database creation, including template0 (which is usually set up to refuse connections). So connect to template1, and create your new template database with using template0 as template. HTH, Markus ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |