Does postgresql by default have a database named `postgres`?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
From http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html, it says:
Run the psql command from the postgres user account:
sudo -u postgres psql postgres
Does the first postgres
mean that psql
will be run by user postgres
?
What does the second postgres
mean?
The manpage of psql
gives
SYNOPSIS
psql [option...] [dbname [username]]
Is the second postgres
a dbname?
Does postgresql by default have a database named postgres
, as well as a user named postgres
?
Thanks.
postgresql
add a comment |Â
up vote
0
down vote
favorite
From http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html, it says:
Run the psql command from the postgres user account:
sudo -u postgres psql postgres
Does the first postgres
mean that psql
will be run by user postgres
?
What does the second postgres
mean?
The manpage of psql
gives
SYNOPSIS
psql [option...] [dbname [username]]
Is the second postgres
a dbname?
Does postgresql by default have a database named postgres
, as well as a user named postgres
?
Thanks.
postgresql
Yes... and yes... and yes... Try this command:sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
From http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html, it says:
Run the psql command from the postgres user account:
sudo -u postgres psql postgres
Does the first postgres
mean that psql
will be run by user postgres
?
What does the second postgres
mean?
The manpage of psql
gives
SYNOPSIS
psql [option...] [dbname [username]]
Is the second postgres
a dbname?
Does postgresql by default have a database named postgres
, as well as a user named postgres
?
Thanks.
postgresql
From http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html, it says:
Run the psql command from the postgres user account:
sudo -u postgres psql postgres
Does the first postgres
mean that psql
will be run by user postgres
?
What does the second postgres
mean?
The manpage of psql
gives
SYNOPSIS
psql [option...] [dbname [username]]
Is the second postgres
a dbname?
Does postgresql by default have a database named postgres
, as well as a user named postgres
?
Thanks.
postgresql
asked Dec 6 '17 at 22:23
Ethan
1032
1032
Yes... and yes... and yes... Try this command:sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28
add a comment |Â
Yes... and yes... and yes... Try this command:sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28
Yes... and yes... and yes... Try this command:
sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28
Yes... and yes... and yes... Try this command:
sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
From sudo documentation:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
From (PostgreSQL) initdb
documentation:
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases.
and
-U username --username=username
Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.
From psql
documentation you quote you can see that, besides options, you call it with either a database name, or a database name and user name
If you do not provide a database name it tries to connect to the database name being the name of the user currently running psql
, as explained in documentation:
The default user name is your operating-system user name, as is the default database name.
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
From sudo documentation:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
From (PostgreSQL) initdb
documentation:
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases.
and
-U username --username=username
Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.
From psql
documentation you quote you can see that, besides options, you call it with either a database name, or a database name and user name
If you do not provide a database name it tries to connect to the database name being the name of the user currently running psql
, as explained in documentation:
The default user name is your operating-system user name, as is the default database name.
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
add a comment |Â
up vote
1
down vote
accepted
From sudo documentation:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
From (PostgreSQL) initdb
documentation:
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases.
and
-U username --username=username
Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.
From psql
documentation you quote you can see that, besides options, you call it with either a database name, or a database name and user name
If you do not provide a database name it tries to connect to the database name being the name of the user currently running psql
, as explained in documentation:
The default user name is your operating-system user name, as is the default database name.
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
From sudo documentation:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
From (PostgreSQL) initdb
documentation:
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases.
and
-U username --username=username
Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.
From psql
documentation you quote you can see that, besides options, you call it with either a database name, or a database name and user name
If you do not provide a database name it tries to connect to the database name being the name of the user currently running psql
, as explained in documentation:
The default user name is your operating-system user name, as is the default database name.
From sudo documentation:
-u user, --user=user
Run the command as a user other than the default target user (usually root).
From (PostgreSQL) initdb
documentation:
Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases.
and
-U username --username=username
Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.
From psql
documentation you quote you can see that, besides options, you call it with either a database name, or a database name and user name
If you do not provide a database name it tries to connect to the database name being the name of the user currently running psql
, as explained in documentation:
The default user name is your operating-system user name, as is the default database name.
edited Dec 7 '17 at 1:23
answered Dec 6 '17 at 22:46
Patrick Mevzek
2,0381721
2,0381721
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
add a comment |Â
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
Thanks. Can you point out where it says " if you do not provide a database name it tries to connect to the database name being the name of the user currently running psql"?
â Ethan
Dec 7 '17 at 0:54
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
I have edited the end of my answer to add the relevant line from psql manual
â Patrick Mevzek
Dec 7 '17 at 1:23
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409332%2fdoes-postgresql-by-default-have-a-database-named-postgres%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Yes... and yes... and yes... Try this command:
sudo -u postgres psql -c "l"
â RubberStamp
Dec 6 '17 at 22:28