pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to recover Data
2+ messages / 2 participants
[nested] [flat]

* How to recover Data
@ 2002-11-26 06:14  Padmanab Sridhar <p_appu@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: p_appu@yahoo.com @ 2002-11-26 06:14 UTC (permalink / raw)
  To: pgsql-sql

I had a m/c with Postgres 7.2 and huge amount of data. on Power
failure and restart of the m/c pgsql refused connect to any of the
database. Being an invoice i took a tar of the data dir.
I tried reinstalling PGSQL and copied the data dir to the same dir
where the new data is being stored. ie
cp /backup/pgsql/data /var/lib/pgsql/data

When i connect to the old database i am able to connect but when i do
a \d to list the tables i get no relations found. Also when i do
select * from a table i am able to get the structure but it has no
records in it.
WHen i check the same info in pg_database to check if the old database
entry is present i dont find it.
Can someone help me as to how to recover my data???
Basically what i feel is update the pg_tables.
Thanks and rgds
Padmanab



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to recover Data
@ 2002-11-26 15:59  mallah@trade-india.com
  parent: Padmanab Sridhar <p_appu@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: mallah@trade-india.com @ 2002-11-26 15:59 UTC (permalink / raw)
  To: p_appu@yahoo.com; +Cc: pgsql-sql; pgsq-admin@postgresql.org

Sridhar

such questions shud be posted to pgsql-admin list.

generally in case of power failure pgsql is unable to remove its
pid file., if u are using RPM based installation the file shud be in
/var/lib/pgsql/ in the name of postmaster.pid

If such a file exists postmaster will refuse to start. in such case
first remove that file. then start postmaster using


# /etc/rc.d/init.d/postgresql start

or better

# su - postgres
$ pg_ctl -l logfile -D /var/lib/pgsql/data

observe the recovery messages in logfile using
$tail -f logfile

in general such recoveries mostly succeeds and in no case
shud be inturrupted to avoid further (grave) complications.

Good Luck with your data,

regds
mallah.

PS: its not easy to loose data with pgsql ;-)


> I had a m/c with Postgres 7.2 and huge amount of data. on Power
> failure and restart of the m/c pgsql refused connect to any of the database. Being an invoice i
> took a tar of the data dir.
> I tried reinstalling PGSQL and copied the data dir to the same dir where the new data is being
> stored. ie
> cp /backup/pgsql/data /var/lib/pgsql/data



Only data directory is not sufficeint u need the pg_xlog directory as
well.

In any case such backups in prociple are not ok unless postmaster
is shut down during the cp.


>
> When i connect to the old database i am able to connect but when i do a \d to list the tables i
> get no relations found. Also when i do
> select * from a table i am able to get the structure but it has no records in it.
> WHen i check the same info in pg_database to check if the old database entry is present i dont
> find it.
> Can someone help me as to how to recover my data???
> Basically what i feel is update the pg_tables.
> Thanks and rgds
> Padmanab
>
> ---------------------------(end of broadcast)--------------------------- TIP 6: Have you
> searched our list archives?
>
> http://archives.postgresql.org



-----------------------------------------
Get your free web based email at trade-india.com.
   "India's Leading B2B eMarketplace.!"
http://www.trade-india.com/





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-11-26 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-26 06:14 How to recover Data Padmanab Sridhar <p_appu@yahoo.com>
2002-11-26 15:59 ` mallah@trade-india.com

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox