Skip to content

Commit 9fb31dc

Browse files
committed
Here is a /doc patch for the oid preservation code.
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
1 parent ab76bbf commit 9fb31dc

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

doc/man/copy.l

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/doc/man/Attic/copy.l,v 1.2 1996/09/19 20:08:09 scrappy Exp $
3+
.\" $Header: /cvsroot/pgsql/doc/man/Attic/copy.l,v 1.3 1996/09/19 20:09:01 scrappy Exp $
44
.TH COPY SQL 11/05/95 Postgres95 Postgres95
55
.SH NAME
66
copy \(em copy data to or from a class from or to a Unix file.
77
.SH SYNOPSIS
88
.nf
9-
\fBcopy\fP [\fBbinary\fP] classname
9+
\fBcopy\fP [\fBbinary\fP] classname [\fBwith oids\fP]
1010
\fBto\fP|\fBfrom\fP "filename"|\fBstdin\fR|\fBstdout\fR
11-
[\fBUSING DELIMITERS\fP delim]
11+
[\fBusing delimiters\fP delim]
1212
.fi
1313
.SH DESCRIPTION
1414
.BR Copy
@@ -18,6 +18,11 @@ keyword
1818
changes the behavior of field formatting, as described below.
1919
.IR Classname
2020
is the name of an existing class.
21+
The keyword
22+
.BR "with oids"
23+
copies the internal unique object id (OID) for each row.
24+
.IR Classname
25+
is the name of an existing class.
2126
.IR Filename
2227
is the Unix pathname of the file. In place of a filename, the
2328
keywords
@@ -26,24 +31,29 @@ can be used so that input to
2631
.BR copy
2732
can be written by a Libpq application and output from the
2833
.BR copy
29-
command can be read by a Libpq application. The
34+
command can be read by a Libpq application.
35+
.PP
36+
The
3037
.BR binary
3138
keyword will force all data to be stored/read as binary objects rather
3239
than as ASCII text. It is somewhat faster than the normal
3340
.BR copy
3441
command, but is not generally portable, and the files generated are
3542
somewhat larger, although this factor is highly dependent on the data
3643
itself.
37-
.PP
38-
By default,
44+
When copying in, the
45+
.BR "with oids"
46+
keyword should only be used on an empty database because
47+
the loaded oids could conflict with existing oids.
48+
By default, a ASCII
3949
.BR copy
4050
uses a tab (\\t) character as a delimiter. The delimiter may also be changed
4151
to any other single-character with the use of
42-
.BR "USING DELIMITERS" .
52+
.BR "using delimiters" .
4353
Characters in data fields which happen to match the delimiter character
4454
will be quoted.
4555
.PP
46-
You must have read access on any class whose values are read by the
56+
You must have read access on any class whose values are read by the
4757
.BR copy
4858
command, and either write or append access to a class to which values
4959
are being appended by the
@@ -69,6 +79,7 @@ The actual format for each instance is
6979
.nf
7080
<attr1><tab><attr2><tab>...<tab><attrn><newline>
7181
.fi
82+
The oid is placed on the beginning of the line if specified.
7283
.PP
7384
If
7485
.BR copy
@@ -111,12 +122,16 @@ this format must be followed
111122
Unsigned four-byte integer quantities are called uint32 in the below
112123
description.
113124
.nf
114-
uint32 totallength (not including itself),
115-
uint32 number of null attributes
116-
[uint32 attribute number of first null attribute
117-
...
118-
uint32 attribute number of nth null attribute],
119-
<data>
125+
The first value is:
126+
uint32 number of tuples
127+
then for each tuple:
128+
uint32 total length of data segment
129+
uint32 oid (if specified)
130+
uint32 number of null attributes
131+
[uint32 attribute number of first null attribute
132+
...
133+
uint32 attribute number of nth null attribute],
134+
<data segment>
120135
.fi
121136
.bp
122137
.SS "ALIGNMENT OF BINARY DATA"

doc/man/pg_dump.1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/doc/man/Attic/pg_dump.1,v 1.1.1.1 1996/08/18 22:14:26 scrappy Exp $
3+
.\" $Header: /cvsroot/pgsql/doc/man/Attic/pg_dump.1,v 1.2 1996/09/19 20:09:02 scrappy Exp $
44
.TH PG_DUMP UNIX 1/20/96 Postgres95 Postgres95
55
.SH NAME
66
pg_dump \(em dumps out a Postgres database into a script file
@@ -21,8 +21,20 @@ port]
2121
.BR "-v"
2222
]
2323
[\c
24+
.BR "-d[a]"
25+
]
26+
[\c
2427
.BR "-S"
2528
help]
29+
[\c
30+
.BR "-a"
31+
]
32+
[\c
33+
.BR "-t"
34+
table]
35+
[\c
36+
.BR "-o"
37+
]
2638
dbname
2739
.in -5n
2840
.SH DESCRIPTION

0 commit comments

Comments
 (0)