Thread: Header meaning for pg_dump

Header meaning for pg_dump

From
"Premsun Choltanwanich"
Date:
Dear All,
 
I had open the backup file of PostgreSQL created by pg_dump command. I found that pg_dump make a comment line as header for each module it backup. I try to understand the meaning of value contained on header for my sample header
 
--
-- TOC entry 1427 (class 1259 OID 1216127)
-- Dependencies: 7
-- Name: t_option; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
Could you please advise me for....  What does they mean? and What the value used for?
 
Thank You.

 
 
 

NETsolutions Asia Limited

+66 (2) 237 7247

NETsolutions Asia Limited

Attachment

Re: Header meaning for pg_dump

From
Richard Huxton
Date:
Premsun Choltanwanich wrote:
> Dear All,
>
> I had open the backup file of PostgreSQL created by pg_dump command. I found
> that pg_dump make a comment line as header for each module it backup. I try to
> understand the meaning of value contained on header for my sample header
>
> --
> -- TOC entry 1427 (class 1259 OID 1216127)
> -- Dependencies: 7
> -- Name: t_option; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
> --
> Could you please advise me for....  What does they mean? and What the value used
> for?

I'm not sure that they're used for anything in that form - that's just
documenting internal details.

TOC - Table Of Contents
OID - Object IDentifier - as used by PG to reference tables,functions etc.
Dependencies - iirc is the number of references to this table (e.g.
foreign keys).
The others explain themselves.

Check the manual section on system tables, and perhaps try:
   SELECT OID,* FROM pg_class WHERE relname='t_option'

HTH
--
   Richard Huxton
   Archonet Ltd

Re: Header meaning for pg_dump

From
"Premsun Choltanwanich"
Date:
Dear Richard,
 
Regarding the information you give to me, I understand that this information is a thing that normally used by PostgreSQL system. And the information seem to be placed on a comment area. So, Who need to have a clearly understanding on the header information?
 
Thank you
 


>>> Richard Huxton <dev@archonet.com> 11/6/2006 15:41 >>>
Premsun Choltanwanich wrote:
> Dear All,

> I had open the backup file of PostgreSQL created by pg_dump command. I found
> that pg_dump make a comment line as header for each module it backup. I try to
> understand the meaning of value contained on header for my sample header

> --
> -- TOC entry 1427 (class 1259 OID 1216127)
> -- Dependencies: 7
> -- Name: t_option; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
> --
> Could you please advise me for....  What does they mean? and What the value used
> for?

I'm not sure that they're used for anything in that form - that's just
documenting internal details.

TOC - Table Of Contents
OID - Object IDentifier - as used by PG to reference tables,functions etc.
Dependencies - iirc is the number of references to this table (e.g.
foreign keys).
The others explain themselves.

Check the manual section on system tables, and perhaps try:
   SELECT OID,* FROM pg_class WHERE relname='t_option'

HTH
--
   Richard Huxton
   Archonet Ltd

NETsolutions Asia Limited

+66 (2) 237 7247

NETsolutions Asia Limited

Attachment

Re: Header meaning for pg_dump

From
Martijn van Oosterhout
Date:
On Tue, Nov 07, 2006 at 08:40:54AM +0700, Premsun Choltanwanich wrote:
> Dear Richard,
>
> Regarding the information you give to me, I understand that this
> information is a thing that normally used by PostgreSQL system. And
> the information seem to be placed on a comment area. So, Who need to
> have a clearly understanding on the header information?

AFAIK nothing (in the main distribution) actually uses it. It's more a
header for people while they're scanning the dump. It also makes a nice
anchor point for sed scripts if you want to extract a single object
from the dump.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment