Обсуждение:

Поиск
Список
Период
Сортировка

От
lee
Дата:
trying to start using pgaccess to import some stuff i exported from
msaccess but seem to be missing a step to allow me to createdb ..

[spiritwind@c1347127-a spiritwind]$ createdb support
psql: connectDBStart() -- connect() failed: No such file or directory       Is the postmaster running locally       and
acceptingconnections on Unix socket '/tmp/.s.PGSQL.5432'?
 
createdb: database creation failed

i've followed docs and having successful initdb i can't start postmaster
with -i option so i can createdb...only allows foreground ie: -D..

if I try -i i get the error above
thx for any help
lee
-===





Re:

От
Peter Eisentraut
Дата:
lee writes:

> [spiritwind@c1347127-a spiritwind]$ createdb support
> psql: connectDBStart() -- connect() failed: No such file or directory
>         Is the postmaster running locally
>         and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
> createdb: database creation failed
>
> i've followed docs and having successful initdb i can't start postmaster
> with -i option so i can createdb...only allows foreground ie: -D..

The -D option is always required, it doesn't have anything to do with -i
or foreground/background.  If you have trouble starting the postmaster,
show us what you're doing and what happens.  Also, reread the
documentation so you know what all the options are for.

-- 
Peter Eisentraut   peter_e@gmx.net



Re:

От
lee
Дата:
> The -D option is always required, it doesn't have anything to do with -i
> or foreground/background.  If you have trouble starting the postmaster,
> show us what you're doing and what happens.  Also, reread the
> documentation so you know what all the options are for.
> 

.....well not quite true according to documentation ( see I read them!
<G> ) as long as you've exported your PATH which I have-- ie: export
PGDATA=/usr/local/pgsql/data
    I then went through:
======================
root# mkdir /usr/local/pgsql/data
root# chown postgres /usr/local/pgsql/data
root# su postgres
postgres> initdb -D /usr/local/pgsql/data

which then told me:
======================
Success. You can now start the database server using:
   /usr/bin/postmaster -D /usr/local/pgsql/data
or   /usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
-----------------------------
    I then typed in:
======================
/usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
which offered me:
============================
pg_ctl: invalid operation mode: /usr/local/pgsql/data


so I tried:
=======================
bash-2.05$ /usr/bin/postmaster -D /usr/local/pgsql/data

which worked but ( I forgot to use -i for interactive which I guess I
need???? ) then do I start another shell and type createdb mydatabase
???....if I try to su postgres from a new shell it asks for password
which i've no clue what it is....what does it default to or am I doing
this part wrong and should be issueing the createdb from same shell I
issues the /usr/bin/postmaster command from ? :)

sorry for this long post but its the only way I know of to explain whats
going on....

thx
lee
-====
    



Re:

От
Tom Lane
Дата:
lee <lee@imyourhandiman.com> writes:
>      I then typed in:
> ======================
> /usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
> which offered me:
> ============================
> pg_ctl: invalid operation mode: /usr/local/pgsql/data

pg_ctl wants the operation first and any options afterwards.  Try

/usr/bin/pg_ctl start -D /usr/local/pgsql/data -l logfile
        regards, tom lane


Re:

От
Peter Eisentraut
Дата:
Tom Lane writes:

> > /usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
> > which offered me:
> > ============================
> > pg_ctl: invalid operation mode: /usr/local/pgsql/data
>
> pg_ctl wants the operation first and any options afterwards.  Try
>
> /usr/bin/pg_ctl start -D /usr/local/pgsql/data -l logfile

This does work in 7.2-something.  It might be a bug in previous versions,
but it sounds a little suspicious that no one ever would have copied the
line from initdb and tried it.

-- 
Peter Eisentraut   peter_e@gmx.net



Re:

От
Peter Eisentraut
Дата:
lee writes:

> bash-2.05$ /usr/bin/postmaster -D /usr/local/pgsql/data
>
> which worked but ( I forgot to use -i for interactive which I guess I
> need???? )

That's not what -i is, and no, you don't need it in your case.

> then do I start another shell and type createdb mydatabase
> ???....

That's a valid possibility.

> if I try to su postgres from a new shell it asks for password
> which i've no clue what it is....what does it default to or am I doing
> this part wrong

That depends on how you set up your "postgres" user account.  This doesn't
have a whole lot to do with PostgreSQL's side of things.

> and should be issueing the createdb from same shell I
> issues the /usr/bin/postmaster command from ? :)

It doesn't matter.

-- 
Peter Eisentraut   peter_e@gmx.net



Re:

От
lee
Дата:
> That depends on how you set up your "postgres" user account.  This doesn't
> have a whole lot to do with PostgreSQL's side of things.
> 
> > and should be issueing the createdb from same shell I
> > issues the /usr/bin/postmaster command from ? :)

okay I finally got the postgres thing ironed out NP I just changed (der)
the passwd which allowed me execution of createdb 'blah'
finally......fine

I opened up pgaccess to open the newly created database and its gives me
this;
------------------
Error trying to connect to database 'blah' on host localhost\
PostgreSQL error
message: Connection to database failed
FATAL 1: Database 'blah' OID18720 has disappeared from pg_database

which step have I missed

lee
-====