Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a180738

Browse files
committed
Changed " to '. Removed bug section from psql. added reminder for log call
in built-in. fixed backslases in source for libpq.
1 parent 54c9905 commit a180738

File tree

4 files changed

+45
-62
lines changed

4 files changed

+45
-62
lines changed

src/man/built-in.3

Lines changed: 2 additions & 2 deletions
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/src/man/Attic/built-in.3,v 1.1 1996/11/14 10:15:15 scrappy Exp $
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.2 1996/11/15 17:55:26 momjian Exp $
44
.TH BUILT-INS INTRO 11/05/95 Postgres95 Postgres95
55
.SH "DESCRIPTION"
66
This section describes the data types, functions and operators
@@ -208,7 +208,7 @@ float8
208208
|/ square root
209209
||/ cube root
210210
: exponential function
211-
; natural logarithm
211+
; natural logarithm (in psql, protect with parentheses)
212212

213213
point
214214
!< A is left of B

src/man/large_objects.3

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /usr/local/devel/postgres/src/ref/RCS/large_objects.3pqsrc,v 1.12 1
4-
993/08/23 09:03:16 aoki Exp $
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/large_objects.3,v 1.2 1996/11/15 17:55:29 momjian Exp $
54
.TH "LARGE OBJECTS" INTRO 03/18/94 Postgres95 Postgres95
65
.SH DESCRIPTION
76
.PP
@@ -16,7 +15,6 @@ This section describes the implementation and the
1615
programmatic and query language interfaces to Postgres large object data.
1716
.PP
1817
.SH "Historical Note"
19-
.SH "Historical Note"
2018
.PP
2119
Originally, postgres 4.2 supports three standard implementations of large
2220
objects: as files external to Postgres, as Unix files managed by Postgres, and as
@@ -27,15 +25,13 @@ it provides stricter data integrity and time travel. For historical reasons,
2725
they are called Inversion large objects. (We will use Inversion and large
2826
objects interchangeably to mean the same thing in this section.)
2927
.SH "Inversion Large Objects"
30-
.SH "Inversion Large Objects"
3128
.PP
3229
The Inversion large
3330
object implementation breaks large objects up into \*(lqchunks\*(rq and
3431
stores the chunks in tuples in the database. A B-tree index
3532
guarantees fast searches for the correct chunk number when doing
3633
random access reads and writes.
3734
.SH "Large Object Interfaces"
38-
.SH "Large Object Interfaces"
3935
.PP
4036
The facilities Postgres provides to access large objects, both in
4137
the backend as part of user-defined functions or the front end
@@ -77,7 +73,6 @@ Postgres provides a set of routines that
7773
support opening, reading, writing, closing, and seeking on large
7874
objects.
7975
.SH "Creating a Large Object"
80-
.SH "Creating a Large Object"
8176
.PP
8277
The routine
8378
.nf
@@ -114,7 +109,6 @@ The commands below create an (Inversion) large object:
114109
inv_oid = lo_creat(INV_READ|INV_WRITE|INV_ARCHIVE);
115110
.fi
116111
.SH "Importing a Large Object"
117-
.SH "Importing a Large Object"
118112
To import a UNIX file as a large object, call
119113
.nf
120114
Oid
@@ -125,7 +119,6 @@ The
125119
argument specifies the UNIX pathname of the file to be imported as
126120
a large object.
127121
.SH "Exporting a Large Object"
128-
.SH "Exporting a Large Object"
129122
To export a large object into UNIX file, call
130123
.nf
131124
int
@@ -138,7 +131,6 @@ the
138131
.I filename
139132
argument specifies the UNIX pathname of the file.
140133
.SH "Opening an Existing Large Object"
141-
.SH "Opening an Existing Large Object"
142134
.PP
143135
To open an existing large object, call
144136
.nf
@@ -165,7 +157,6 @@ and
165157
.B lo_close .
166158
.\"-----------
167159
.SH "Writing Data to a Large Object"
168-
.SH "Writing Data to a Large Object"
169160
.PP
170161
The routine
171162
.nf
@@ -187,7 +178,6 @@ The number of bytes actually written is returned.
187178
In the event of an error,
188179
the return value is negative.
189180
.SH "Seeking on a Large Object"
190-
.SH "Seeking on a Large Object"
191181
.PP
192182
To change the current read or write location on a large object,
193183
call
@@ -207,7 +197,6 @@ and
207197
.SM SEEK_END.
208198
.\"-----------
209199
.SH "Closing a Large Object Descriptor"
210-
.SH "Closing a Large Object Descriptor"
211200
.PP
212201
A large object may be closed by calling
213202
.nf
@@ -223,7 +212,6 @@ On success,
223212
returns zero. On error, the return value is negative.
224213
.PP
225214
.SH "Built in registered functions"
226-
.SH "Built in registered functions"
227215
.PP
228216
There are two built-in registered functions,
229217
.I lo_import
@@ -241,12 +229,11 @@ CREATE TABLE image (
241229
INSERT INTO image (name, raster)
242230
VALUES ('beautiful image', lo_import('/etc/motd'));
243231

244-
SELECT lo_export(image.raster, "/tmp/motd") from image
232+
SELECT lo_export(image.raster, '/tmp/motd') from image
245233
WHERE name = 'beautiful image';
246234
.fi
247235
.PP
248236
.SH "Accessing Large Objects from LIBPQ"
249-
.SH "Accessing Large Objects from LIBPQ"
250237
Below is a sample program which shows how the large object interface in
251238
\*(LP can be used. Parts of the program are commented out but are left
252239
in the source for the readers benefit. This program can be found in
@@ -262,7 +249,6 @@ and link with the
262249
library.
263250
.bp
264251
.SH "Sample Program"
265-
.SH "Sample Program"
266252
.nf
267253
/*-------------------------------------------------------------------------
268254
*
@@ -273,7 +259,7 @@ library.
273259
*
274260
*
275261
* IDENTIFICATION
276-
* $Header: /cvsroot/pgsql/src/man/Attic/large_objects.3,v 1.1 1996/11/14 10:17:24 scrappy Exp $
262+
* $Header: /cvsroot/pgsql/src/man/Attic/large_objects.3,v 1.2 1996/11/15 17:55:29 momjian Exp $
277263
*
278264
*-------------------------------------------------------------------------
279265
*/
@@ -301,7 +287,7 @@ Oid importFile(PGconn *conn, char *filename)
301287
*/
302288
fd = open(filename, O_RDONLY, 0666);
303289
if (fd < 0) { /* error */
304-
fprintf(stderr, "can't open unix file\"%s\"\n", filename);
290+
fprintf(stderr, "can't open unix file\\"%s\\"\\n", filename);
305291
}
306292

307293
/*
@@ -319,7 +305,7 @@ Oid importFile(PGconn *conn, char *filename)
319305
while ((nbytes = read(fd, buf, BUFSIZE)) > 0) {
320306
tmp = lo_write(conn, lobj_fd, buf, nbytes);
321307
if (tmp < nbytes) {
322-
fprintf(stderr, "error while reading \"%s\"", filename);
308+
fprintf(stderr, "error while reading \\"%s\\"", filename);
323309
}
324310
}
325311

@@ -348,11 +334,11 @@ void pickout(PGconn *conn, Oid lobjId, int start, int len)
348334
nread = 0;
349335
while (len - nread > 0) {
350336
nbytes = lo_read(conn, lobj_fd, buf, len - nread);
351-
buf[nbytes] = '\0';
337+
buf[nbytes] = '\\0';
352338
fprintf(stderr,">>> %s", buf);
353339
nread += nbytes;
354340
}
355-
fprintf(stderr,"\n");
341+
fprintf(stderr,"\\n");
356342
lo_close(conn, lobj_fd);
357343
}
358344

@@ -375,14 +361,14 @@ void overwrite(PGconn *conn, Oid lobjId, int start, int len)
375361

376362
for (i=0;i<len;i++)
377363
buf[i] = 'X';
378-
buf[i] = '\0';
364+
buf[i] = '\\0';
379365

380366
nwritten = 0;
381367
while (len - nwritten > 0) {
382368
nbytes = lo_write(conn, lobj_fd, buf + nwritten, len - nwritten);
383369
nwritten += nbytes;
384370
}
385-
fprintf(stderr,"\n");
371+
fprintf(stderr,"\\n");
386372
lo_close(conn, lobj_fd);
387373
}
388374

@@ -413,7 +399,7 @@ void exportFile(PGconn *conn, Oid lobjId, char *filename)
413399
*/
414400
fd = open(filename, O_CREAT|O_WRONLY, 0666);
415401
if (fd < 0) { /* error */
416-
fprintf(stderr, "can't open unix file\"%s\"",
402+
fprintf(stderr, "can't open unix file\\"%s\\"",
417403
filename);
418404
}
419405

@@ -423,7 +409,7 @@ void exportFile(PGconn *conn, Oid lobjId, char *filename)
423409
while ((nbytes = lo_read(conn, lobj_fd, buf, BUFSIZE)) > 0) {
424410
tmp = write(fd, buf, nbytes);
425411
if (tmp < nbytes) {
426-
fprintf(stderr,"error while writing \"%s\"",
412+
fprintf(stderr,"error while writing \\"%s\\"",
427413
filename);
428414
}
429415
}
@@ -451,7 +437,7 @@ main(int argc, char **argv)
451437
PGresult *res;
452438

453439
if (argc != 4) {
454-
fprintf(stderr, "Usage: %s database_name in_filename out_filename\n",
440+
fprintf(stderr, "Usage: %s database_name in_filename out_filename\\n",
455441
argv[0]);
456442
exit(1);
457443
}
@@ -467,27 +453,27 @@ main(int argc, char **argv)
467453

468454
/* check to see that the backend connection was successfully made */
469455
if (PQstatus(conn) == CONNECTION_BAD) {
470-
fprintf(stderr,"Connection to database '%s' failed.\n", database);
456+
fprintf(stderr,"Connection to database '%s' failed.\\n", database);
471457
fprintf(stderr,"%s",PQerrorMessage(conn));
472458
exit_nicely(conn);
473459
}
474460

475461
res = PQexec(conn, "begin");
476462
PQclear(res);
477-
printf("importing file \"%s\" ...\n", in_filename);
463+
printf("importing file \\"%s\\" ...\\n", in_filename);
478464
/* lobjOid = importFile(conn, in_filename); */
479465
lobjOid = lo_import(conn, in_filename);
480466
/*
481-
printf("\tas large object %d.\n", lobjOid);
467+
printf("\\tas large object %d.\\n", lobjOid);
482468

483-
printf("picking out bytes 1000-2000 of the large object\n");
469+
printf("picking out bytes 1000-2000 of the large object\\n");
484470
pickout(conn, lobjOid, 1000, 1000);
485471

486-
printf("overwriting bytes 1000-2000 of the large object with X's\n");
472+
printf("overwriting bytes 1000-2000 of the large object with X's\\n");
487473
overwrite(conn, lobjOid, 1000, 1000);
488474
*/
489475

490-
printf("exporting large object to file \"%s\" ...\n", out_filename);
476+
printf("exporting large object to file \\"%s\\" ...\\n", out_filename);
491477
/* exportFile(conn, lobjOid, out_filename); */
492478
lo_export(conn, lobjOid,out_filename);
493479

0 commit comments

Comments
 (0)