Re: odd problem ! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: odd problem !
Date
Msg-id 20099.1111530420@sss.pgh.pa.us
Whole thread Raw
In response to odd problem !  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: odd problem !  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers
Oleg Bartunov <oleg@sai.msu.su> writes:
> below is the problem I just bitten when play with toy db. I did:

> 1.initdb -D ./t1
> 2. pg_ctl -D ./t1 start
> 3. createdb test
> 4. psql test -c "create table a (f integer);"
> 5. run script which populates table a in background
>     perl bgupdate.pl &
> 6. cp -a ./t1 ./t2

I would not really expect this to produce a usable copy at all...

> 6. pg_ctl -D ./t1 stop
>     it's waiting for bgupdate.pl, so I killed script
> 7. pg_ct -D ./t2 start
>     see, that everything is fine.

Exactly how much did you test?  However, that doesn't seem relevant
to your subsequent problem with the original.

> 8. pg_ctl -D ./t2 stop
> 9. pg_ctl -D ./t1 start
> 10.

> pg@zen:~/test$ psql -l
>          List of databases
>     Name    |  Owner   | Encoding 
> -----------+----------+----------
>   template0 | postgres | KOI8
>   template1 | postgres | KOI8
>   test      | postgres | KOI8
> (3 rows)

> 11.
> pg@zen:~/test$ psql test
> FATAL:  database "test" does not exist
> psql: FATAL:  database "test" does not exist

What PG version is this exactly?  I suppose that you're seeing one of
the GetRawDatabase corner cases, but I'm not quite sure why the shutdown
and restart after the createdb wouldn't have fixed it.  Does vacuuming
pg_database and then checkpointing make it work?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: odd problem !
Next
From: Mark Wong
Date:
Subject: Re: WAL: O_DIRECT and multipage-writer