10beta1 role

Started by Ray Stellalmost 9 years ago17 messagesgeneral
Jump to latest
#1Ray Stell
stellr@vt.edu

I used "initdb -U" to specify an alternate superuser. On startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql" does
not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ray Stell (#1)
Re: 10beta1 role

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql" does
not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Melvin Davidson
melvin6925@gmail.com
In reply to: Adrian Klaver (#2)
Re: 10beta1 role

On Thu, Jun 22, 2017 at 4:07 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql" does
not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

It would be useful to know the O/S and PostgreSQL version.
That way we can direct you to where to find that start up command to modify
it.

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

#4Jeff Janes
jeff.janes@gmail.com
In reply to: Ray Stell (#1)
Re: 10beta1 role

On Thu, Jun 22, 2017 at 12:06 PM, Ray Stell <stellr@vt.edu> wrote:

I used "initdb -U" to specify an alternate superuser. On startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql" does
not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

Earlier versions do the same thing if you start them with the wait option
(-w).

The difference is that wait is now the default, and you use -W to turn it
off.

With the wait option in use, when starting up the server pg_ctl keeps
trying to connect to the server so once it is running, it can report
success. But it doesn't know who to connect as, so it just uses the default.

Cheers,

Jeff

#5Ray Stell
stellr@vt.edu
In reply to: Adrian Klaver (#2)
Re: 10beta1 role

On 6/22/17 4:07 PM, Adrian Klaver wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

initdb -D /apps/pgsql/workspace/database/test -U newsuperuser

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Ray Stell
stellr@vt.edu
In reply to: Melvin Davidson (#3)
Re: 10beta1 role

On 6/22/17 4:10 PM, Melvin Davidson wrote:

On Thu, Jun 22, 2017 at 4:07 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On
startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role
"postgresql" does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION:
InitializeSessionUserId, miscinit.c:503

--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org
<mailto:pgsql-general@postgresql.org>)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
<http://www.postgresql.org/mailpref/pgsql-general&gt;

It would be useful to know the O/S and PostgreSQL version.

10beta1/CentOS 6.

#7Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Jeff Janes (#4)
Re: 10beta1 role

On 06/22/2017 01:13 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 12:06 PM, Ray Stell <stellr@vt.edu
<mailto:stellr@vt.edu>> wrote:

I used "initdb -U" to specify an alternate superuser. On startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

Earlier versions do the same thing if you start them with the wait
option (-w).

The difference is that wait is now the default, and you use -W to turn
it off.

The would seem to work for the pg_ctl init[db] mode, however the OP is
using the plain initdb where -W is:

-W
--pwprompt

Makes initdb prompt for a password to give the database superuser.
If you don't plan on using password authentication, this is not
important. Otherwise you won't be able to use password authentication
until you have a password set up.

Would that still work?

With the wait option in use, when starting up the server pg_ctl keeps
trying to connect to the server so once it is running, it can report
success. But it doesn't know who to connect as, so it just uses the default.

Cheers,

Jeff

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#8Jeff Janes
jeff.janes@gmail.com
In reply to: Adrian Klaver (#7)
Re: 10beta1 role

On Thu, Jun 22, 2017 at 1:22 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 06/22/2017 01:13 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 12:06 PM, Ray Stell <stellr@vt.edu <mailto:
stellr@vt.edu>> wrote:

I used "initdb -U" to specify an alternate superuser. On startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

Earlier versions do the same thing if you start them with the wait option
(-w).

The difference is that wait is now the default, and you use -W to turn it
off.

The would seem to work for the pg_ctl init[db] mode, however the OP is
using the plain initdb where -W is:

-W
--pwprompt

But he is seeing the message when he starts the database, not when he does
initdb of it.

Cheers,

Jeff

#9Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Jeff Janes (#8)
Re: 10beta1 role

On 06/22/2017 01:29 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 1:22 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 06/22/2017 01:13 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 12:06 PM, Ray Stell <stellr@vt.edu
<mailto:stellr@vt.edu> <mailto:stellr@vt.edu
<mailto:stellr@vt.edu>>> wrote:

I used "initdb -U" to specify an alternate superuser. On
startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role
"postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION:
InitializeSessionUserId,
miscinit.c:503

Earlier versions do the same thing if you start them with the
wait option (-w).

The difference is that wait is now the default, and you use -W
to turn it off.

The would seem to work for the pg_ctl init[db] mode, however the OP
is using the plain initdb where -W is:

-W
--pwprompt

But he is seeing the message when he starts the database, not when he
does initdb of it.

Hmm, on my machine:

/usr/local/pgsql10/bin/initdb -D pg100/ -U aklaver
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory pg100 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start
waiting for server to start.... done
server started

/usr/local/pgsql10/bin/psql -d postgres -U aklaver -p 5472
psql (10beta1)
Type "help" for help.

postgres=# \du
List of roles
Role name | Attributes
| Member of
-----------+------------------------------------------------------------+-----------
aklaver | Superuser, Create role, Create DB, Replication, Bypass RLS
| {}

Cheers,

Jeff

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#10Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ray Stell (#5)
Re: 10beta1 role

On 06/22/2017 01:16 PM, Ray Stell wrote:

On 6/22/17 4:07 PM, Adrian Klaver wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION: InitializeSessionUserId,
miscinit.c:503

initdb -D /apps/pgsql/workspace/database/test -U newsuperuser

So per Jeff's comments, how are you starting the Postgres instance?

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#11Ray Stell
stellr@vt.edu
In reply to: Adrian Klaver (#9)
Re: 10beta1 role

On 6/22/17 4:34 PM, Adrian Klaver wrote:

On 06/22/2017 01:29 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 1:22 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 06/22/2017 01:13 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 12:06 PM, Ray Stell <stellr@vt.edu
<mailto:stellr@vt.edu> <mailto:stellr@vt.edu
<mailto:stellr@vt.edu>>> wrote:

I used "initdb -U" to specify an alternate superuser. On
startup it
throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role
"postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION:
InitializeSessionUserId,
miscinit.c:503

Earlier versions do the same thing if you start them with the
wait option (-w).

The difference is that wait is now the default, and you use -W
to turn it off.

The would seem to work for the pg_ctl init[db] mode, however the OP
is using the plain initdb where -W is:

-W
--pwprompt

But he is seeing the message when he starts the database, not when he
does initdb of it.

Hmm, on my machine:

/usr/local/pgsql10/bin/initdb -D pg100/ -U aklaver
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory pg100 ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start
waiting for server to start.... done
server started

/usr/local/pgsql10/bin/psql -d postgres -U aklaver -p 5472
psql (10beta1)
Type "help" for help.

postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------

aklaver | Superuser, Create role, Create DB, Replication, Bypass
RLS | {}

Cheers,

Jeff

are the role msgs in logfile?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#12Jeff Janes
jeff.janes@gmail.com
In reply to: Adrian Klaver (#9)
Re: 10beta1 role

On Thu, Jun 22, 2017 at 1:34 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 06/22/2017 01:29 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 1:22 PM, Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

On 06/22/2017 01:13 PM, Jeff Janes wrote:

But he is seeing the message when he starts the database, not when he
does initdb of it.

Hmm, on my machine:

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start
waiting for server to start.... done
server started

But look inside "logfile".

/usr/local/pgsql10/bin/psql -d postgres -U aklaver -p 5472
psql (10beta1)
Type "help" for help.

postgres=# \du

Right, the database starts. pg_ctl just can't prove it started, because it
doesn't know how to connect to it.

Cheers,

Jeff

#13Ray Stell
stellr@vt.edu
In reply to: Adrian Klaver (#10)
Re: 10beta1 role

On 6/22/17 4:36 PM, Adrian Klaver wrote:

On 06/22/2017 01:16 PM, Ray Stell wrote:

On 6/22/17 4:07 PM, Adrian Klaver wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION:
InitializeSessionUserId, miscinit.c:503

initdb -D /apps/pgsql/workspace/database/test -U newsuperuser

So per Jeff's comments, how are you starting the Postgres instance?

pg_ctl start -D ...

I added -W to the initdb, but the startup has same msg. same. As I
said, the postmaster starts. I just thought the msgs might not be desired.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#14Jeff Janes
jeff.janes@gmail.com
In reply to: Jeff Janes (#12)
Re: 10beta1 role

On Thu, Jun 22, 2017 at 1:39 PM, Jeff Janes <jeff.janes@gmail.com> wrote:

On Thu, Jun 22, 2017 at 1:34 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 06/22/2017 01:29 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 1:22 PM, Adrian Klaver <
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 06/22/2017 01:13 PM, Jeff Janes wrote:

But he is seeing the message when he starts the database, not when he
does initdb of it.

Hmm, on my machine:

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start
waiting for server to start.... done
server started

But look inside "logfile".

/usr/local/pgsql10/bin/psql -d postgres -U aklaver -p 5472
psql (10beta1)
Type "help" for help.

postgres=# \du

Right, the database starts. pg_ctl just can't prove it started, because
it doesn't know how to connect to it.

Correction, it can prove it started, because when it connects as the wrong
user, it gets an error message which it would only get if the database is
up. But in the process, it leaves a message behind in the server's log
file.

Cheers,

Jeff

#15Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ray Stell (#13)
Re: 10beta1 role

On 06/22/2017 01:41 PM, Ray Stell wrote:

On 6/22/17 4:36 PM, Adrian Klaver wrote:

On 06/22/2017 01:16 PM, Ray Stell wrote:

On 6/22/17 4:07 PM, Adrian Klaver wrote:

On 06/22/2017 12:06 PM, Ray Stell wrote:

I used "initdb -U" to specify an alternate superuser. On startup it

Can you show your complete initdb command?

throws these msgs:

2017-06-22 14:36:34 EDT,0,startup FATAL: 28000: role "postgresql"
does not exist

2017-06-22 14:36:34 EDT,0,startup LOCATION:
InitializeSessionUserId, miscinit.c:503

initdb -D /apps/pgsql/workspace/database/test -U newsuperuser

So per Jeff's comments, how are you starting the Postgres instance?

pg_ctl start -D ...

I added -W to the initdb, but the startup has same msg. same. As I
said, the postmaster starts. I just thought the msgs might not be desired.

Went into the logfile and with:

/usr/local/pgsql10/bin/pg_ctl -D pg100/ -l logfile start

I got:

2017-06-22 13:29:27.706 PDT [12924] LOG: database system is ready to
accept connections
2017-06-22 13:29:28.476 PDT [12932] FATAL: role "postgres" does not exist

With:

/usr/local/pgsql10/bin/pg_ctl -W -D pg100/ -l logfile start

I did not get the error.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#16Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Jeff Janes (#14)
Re: 10beta1 role

On 06/22/2017 01:43 PM, Jeff Janes wrote:

On Thu, Jun 22, 2017 at 1:39 PM, Jeff Janes <jeff.janes@gmail.com
<mailto:jeff.janes@gmail.com>> wrote:

Correction, it can prove it started, because when it connects as the
wrong user, it gets an error message which it would only get if the
database is up. But in the process, it leaves a message behind in the
server's log file.

Basically it pings the server with whatever information it has at that
stage in the startup procedure until hopefully it has the complete
information needed.

Cheers,

Jeff

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#17Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ray Stell (#13)
Re: 10beta1 role

Ray Stell <stellr@vt.edu> writes:

I added -W to the initdb, but the startup has same msg. same. As I
said, the postmaster starts. I just thought the msgs might not be desired.

In principle, we could add a -U option to pg_ctl to tell it to do test
connections with a userid other than your OS name. Nobody's particularly
felt the need though, since the log message is harmless.

[ pokes at it a bit... ] Actually, you don't need a -U switch,
because setting PGUSER in pg_ctl's environment works.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general