Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

template1 database and pg_hba.conf questions

Status
Not open for further replies.

Zteev

Programmer
Jul 28, 2003
17
US
Hi people,

My question is about template1 database. I am connected to my postgreSQL server via pgAdminIII and I am also logged locally to my server and running psql. When I try to create a new database in psql, it returns me this:
ERROR: source database "template1" is being accessed by other users

Obviously, its because I am logged to postgresql from pgAdminIII ; when I close it and try again it works.

My question`s why? I will have to create new databases while other users are logged in! Am I doing things wrong here?

Thanks in advance,

Best regards,

Zteev
 
you can create databases when others are connected, but not to template1 ;-((

you can create databases even then (when someone connected to template1), but you can create them from template0

the reason is that when db is created it is created from a template, the default is template1 and when creating it the template should be locked so a copy to be made there is no other way ;-(

probably pgAdmin connects to template1 and that is the problem

if you haven't made changes to template1 you can defenetly use template0

createdb -T template0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top