Re: Postgres file structure doubt

From: mailtolouis2020-postgres(at)yahoo(dot)com
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres file structure doubt
Date: 2007-11-20 16:38:18
Message-ID: 642742.85615.qm@web30406.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Scott,

Thanks for clear my doubt. Yes, I'm planning to do PITR backup.
Another question, from what I understand, when there are data transaction going on, postgres will store in the log file, which is in /usr/local/pgsql/data/pg_xlog, when these data will finally save it into /database/pg/mydata?

For e.g, if I did a pg_dump backup a week ago, and the system crash today, but I'm able to get all the files in /usr/local/pgsql/data/pg_xlog, can I still recover my database to the latest state?

Regards
Louis

----- Original Message ----
From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: mailtolouis2020-postgres(at)yahoo(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Sent: Monday, November 19, 2007 5:38:12 PM
Subject: Re: [GENERAL] Postgres file structure doubt

On Nov 19, 2007 11:24 AM, <mailtolouis2020-postgres(at)yahoo(dot)com> wrote:
>
> Hi everyone,
>
> Got a doubt in my setup, please correct me if I'm wrong.
>
> In my postgres setup,
> /usr/local/pgsql (where postgres install)
> /usr/local/pgsql/data (PGDATA)
> /database/pg/mydata (tablespace which use for all the table I create)
> /database/pg/myindex (index which use for all the table I create)
>
> 1) In this setup, the actual user data are store in PGDATA
> the table structure & index are store in /database/pg/mydata &
> /database/pg/myindex
>
> Am I correct?

The data that defines users, and tables, and other objects are in
PGDATA. The data from users are stored in mydata/myindex. Not sure
if that matches what you wrote or not...

> 2) So to backup (not pg_dump), I should make sure it include these 2 folder
> right?
>
> /usr/local/pgsql/data
> /database/pg/

To backup, you should generally use pg_dump. Are you planning on
using PITR? Are you planning on shutting down your database when you
back it up? if you're not using PITR, you must shut down postgresql
to take a file system backup.

> 3) I think my setup is not quite right, I should move the PGDATA to
> /database/pg right?

Sorta a personaly choice really.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2007-11-20 17:00:22 Re: Postgres file structure doubt
Previous Message Brad Nicholson 2007-11-20 16:13:26 Re: postgresql storage and performance questions