I'm a bit anxious at the moment. Things have been going just fine for a
couple months and this afternoon Something Bad (tm) happenend.
Summary. I had 8 databases, I created another one for 9. I started
psql and created a table, created a user, and granted permissions. I
then did a \z to check up on things. Lo and behold, I have 3/4 of the
tables from another database moved into here! I disconnect, reconnect,
yep, still there. I connect to the other database and those tables are
missing. I'm absolutely positive that these tables were in 'hmzbook'
before this. I triple checked and examined a dated pg_dump from a few
days ago and 'hmzbook' was correct.
$ psql -l
Password:
List of databases
Name | Owner
-----------------+-----------
gayladb | gayla
hmzbook | hmz
horde | postgres
pg_auth | postgres
sendmail | mailadmin
sendmailexample | mailadmin
template0 | postgres
template1 | postgres
(8 rows)
$ createdb sysinfo_archive
Password:
CREATE DATABASE
$ psql -d sysinfo_archive
Password:
Welcome to psql, the PostgreSQL interactive terminal.
...
sysinfo_archive=# create table sysinfo ( timestamp timestamp default
'now', host inet not null, component varchar not null, node varchar not
null, identity varchar not null, value int8 default 0 );
CREATE
sysinfo_archive=# insert into sysinfo
(host,component,node,identity,value) values
('1.2.3.4','network','eth0','bytes in','1234');
INSERT 26374 1
sysinfo_archive=# create user mouse with encrypted password 'xxxx';
CREATE USER
sysinfo_archive=# grant select,insert on sysinfo to mouse;
GRANT
sysinfo_archive=# \z
Access privileges for database "sysinfo_archive"
Table | Access privileges
--------------------------+-------------------------------
autthoughts |
guestbook |
guestbook_id_seq |
id_seq |
iquotes |
iquotes_id_seq |
ircfriends |
ircfriends_id_seq |
ircfriendsfriends_id_seq |
picture |
profile |
sysinfo | {=,postgres=arwdRxt,mouse=ar}
temporary |
(13 rows)
What the heck just happened and short of dumping these tables out and
importing them back into the other database...
a) how can I fix this and
b) how can I prevent this from happening again?
Very concerned,
David