Discussion:
[Pgcluster-general] ERROR: source database "template1" is being accessed by other users
Rob Reed
2005-06-22 18:40:16 UTC
Permalink
PGcluster 1.3.0c with PostgreSQL 8.0.3

Two servers:

1) Replicate and ClusterDB
2) ClusterDB

Problem: When I try and run "createdb" on either server, the main
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"

Does anyone have any info to fix this problem?

Thanks,
Rob
Rick Vernam
2005-06-22 18:58:50 UTC
Permalink
have you tried
"psql -d template1" (and of course -h [hostname] -p [port number] -U
[username] if needed)
and the sql command
"CREATE DATABASE [database name]"

just a thought about working around...no thought given to initial problem.

-Rick
Post by Rob Reed
PGcluster 1.3.0c with PostgreSQL 8.0.3
1) Replicate and ClusterDB
2) ClusterDB
Problem: When I try and run "createdb" on either server, the main
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"
Does anyone have any info to fix this problem?
Thanks,
Rob
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
Maurizio Giosia
2005-06-22 19:34:47 UTC
Permalink
i've got the same problem... in my situation this problem occours when
a windows client with pgadmin is logged in with "initial database"
option in the "add connection" dialog set to template1

hope that helps...
Maurizio
Post by Rick Vernam
have you tried
"psql -d template1" (and of course -h [hostname] -p [port number] -U
[username] if needed)
and the sql command
"CREATE DATABASE [database name]"
just a thought about working around...no thought given to initial problem.
-Rick
Post by Rob Reed
PGcluster 1.3.0c with PostgreSQL 8.0.3
1) Replicate and ClusterDB
2) ClusterDB
Problem: When I try and run "createdb" on either server, the main
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"
Does anyone have any info to fix this problem?
Thanks,
Rob
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
Rob Reed
2005-06-22 20:50:13 UTC
Permalink
I do not have any scripts or clients accessing the newly installed
database server. I did try "psql -d template1" then the SQL command of
"CREATE DATABASE [database name]" and received the same error.

I have followed the steps from this site for the setup
http://pgcluster.projects.postgresql.org/1_3/

I've done this setup on a couple computers to only have the exact same
result. Any other ideas?

Thanks,
Rob
Post by Maurizio Giosia
i've got the same problem... in my situation this problem occours when
a windows client with pgadmin is logged in with "initial database"
option in the "add connection" dialog set to template1
hope that helps...
Maurizio
Post by Rick Vernam
have you tried
"psql -d template1" (and of course -h [hostname] -p [port number]
-U
Post by Maurizio Giosia
Post by Rick Vernam
[username] if needed)
and the sql command
"CREATE DATABASE [database name]"
just a thought about working around...no thought given to initial
problem.
Post by Maurizio Giosia
Post by Rick Vernam
-Rick
Post by Rob Reed
PGcluster 1.3.0c with PostgreSQL 8.0.3
1) Replicate and ClusterDB
2) ClusterDB
Problem: When I try and run "createdb" on either server, the main
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"
Does anyone have any info to fix this problem?
Thanks,
Rob
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
Rick Vernam
2005-06-22 21:23:13 UTC
Permalink
Do you have any other databases? there is template0 & template1 by
default...but have you ever created others?
The reason I ask is because with createdb you can tell it to use some other
template "createdb --help":
-T, --template=TEMPLATE template database to copy

So, if you do "ps -AF | grep template1" you see, at most a single line like
this:
root 19694 19548 0 355 472 0 16:14 pts/0 00:00:00 grep template1
and maybe even nothing?

I do not know why your having this problem, I have never had a problem like
this...and I've done lots of setups and what not...
Here is something worth tyring.
Take everything down (both ClusterDBs & the Replicator).
Pick a cluster db & edit its cluster.conf, find the line that starts with
"<When_Stand_Alone>" and make it say "<When_Stand_Alone> read_write
</When_Stand_Alone>"
Then, save the .conf & start up just that one ClusterDB, nothing else. Try to
create the database then. Assuming the database is successfully created,
take the ClusterDB back down, return the .conf file back to original and save
it. Start the ClusterDB that you created the db on & the replicator as
usual...then, start the other Cluster DB with the -R option (pg_ctl -D
[wherever] -l [whereever] -o "-i -R" start ... or whatever your options are,
just make sure you get that -R in there...). rather sloppy, and not
something you'd want to do every time you create a new database, but maybe
it'll get you started...

-Rick
Post by Rob Reed
I do not have any scripts or clients accessing the newly installed
database server. I did try "psql -d template1" then the SQL command of
"CREATE DATABASE [database name]" and received the same error.
I have followed the steps from this site for the setup
http://pgcluster.projects.postgresql.org/1_3/
I've done this setup on a couple computers to only have the exact same
result. Any other ideas?
Thanks,
Rob
Post by Maurizio Giosia
i've got the same problem... in my situation this problem occours when
a windows client with pgadmin is logged in with "initial database"
option in the "add connection" dialog set to template1
hope that helps...
Maurizio
Post by Rick Vernam
have you tried
"psql -d template1" (and of course -h [hostname] -p [port number]
-U
Post by Maurizio Giosia
Post by Rick Vernam
[username] if needed)
and the sql command
"CREATE DATABASE [database name]"
just a thought about working around...no thought given to initial
problem.
Post by Maurizio Giosia
Post by Rick Vernam
-Rick
Post by Rob Reed
PGcluster 1.3.0c with PostgreSQL 8.0.3
1) Replicate and ClusterDB
2) ClusterDB
Problem: When I try and run "createdb" on either server, the main
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"
Does anyone have any info to fix this problem?
Thanks,
Rob
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
Rob Reed
2005-06-23 19:03:37 UTC
Permalink
Using template0 did fix the problem. It looks like the replicator when
started locks template1, is this normal?

debug info from pggreplicate..

-------------------------
DEBUG:from_host=cluster1
DEBUG:dbName=template1
DEBUG:userName=postgres
-------------------------

Thanks for the fix.

Rob
Post by Rick Vernam
Do you have any other databases? there is template0 & template1 by
default...but have you ever created others?
The reason I ask is because with createdb you can tell it to use some
other
Post by Rick Vernam
-T, --template=TEMPLATE template database to copy
So, if you do "ps -AF | grep template1" you see, at most a single line
like
Post by Rick Vernam
root 19694 19548 0 355 472 0 16:14 pts/0 00:00:00 grep
template1
Post by Rick Vernam
and maybe even nothing?
I do not know why your having this problem, I have never had a problem
like
Post by Rick Vernam
this...and I've done lots of setups and what not...
Here is something worth tyring.
Take everything down (both ClusterDBs & the Replicator).
Pick a cluster db & edit its cluster.conf, find the line that starts
with
Post by Rick Vernam
"<When_Stand_Alone>" and make it say "<When_Stand_Alone> read_write
</When_Stand_Alone>"
Then, save the .conf & start up just that one ClusterDB, nothing
else. Try to
Post by Rick Vernam
create the database then. Assuming the database is successfully
created,
Post by Rick Vernam
take the ClusterDB back down, return the .conf file back to original
and save
Post by Rick Vernam
it. Start the ClusterDB that you created the db on & the replicator
as
Post by Rick Vernam
usual...then, start the other Cluster DB with the -R option (pg_ctl -D
[wherever] -l [whereever] -o "-i -R" start ... or whatever your
options are,
Post by Rick Vernam
just make sure you get that -R in there...). rather sloppy, and not
something you'd want to do every time you create a new database, but
maybe
Post by Rick Vernam
it'll get you started...
-Rick
Post by Rob Reed
I do not have any scripts or clients accessing the newly installed
database server. I did try "psql -d template1" then the SQL command
of
Post by Rick Vernam
Post by Rob Reed
"CREATE DATABASE [database name]" and received the same error.
I have followed the steps from this site for the setup
http://pgcluster.projects.postgresql.org/1_3/
I've done this setup on a couple computers to only have the exact
same
Post by Rick Vernam
Post by Rob Reed
result. Any other ideas?
Thanks,
Rob
Post by Maurizio Giosia
i've got the same problem... in my situation this problem occours
when
Post by Rick Vernam
Post by Rob Reed
Post by Maurizio Giosia
a windows client with pgadmin is logged in with "initial database"
option in the "add connection" dialog set to template1
hope that helps...
Maurizio
Post by Rick Vernam
have you tried
"psql -d template1" (and of course -h [hostname] -p [port
number]
Post by Rick Vernam
Post by Rob Reed
-U
Post by Maurizio Giosia
Post by Rick Vernam
[username] if needed)
and the sql command
"CREATE DATABASE [database name]"
just a thought about working around...no thought given to
initial
Post by Rick Vernam
Post by Rob Reed
problem.
Post by Maurizio Giosia
Post by Rick Vernam
-Rick
Post by Rob Reed
PGcluster 1.3.0c with PostgreSQL 8.0.3
1) Replicate and ClusterDB
2) ClusterDB
Problem: When I try and run "createdb" on either server, the
main
Post by Rick Vernam
Post by Rob Reed
Post by Maurizio Giosia
Post by Rick Vernam
Post by Rob Reed
clusterDB errors to standard out with "ERROR: source database
"template1" is being accessed by other users"
Does anyone have any info to fix this problem?
Thanks,
Rob
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
_______________________________________________
Pgcluster-general mailing list
Pgcluster-general at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgcluster-general
Loading...