1
1
# -------------------------------------------------------
2
2
#
3
- # $Id: Pg.pm,v 1.2 1997/06/02 19:42:01 mergl Exp $
3
+ # $Id: Pg.pm,v 1.3 1997/09/17 20:46:21 mergl Exp $
4
4
#
5
5
# Copyright (c) 1997 Edmund Mergl
6
6
#
@@ -15,7 +15,7 @@ use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
15
15
require Exporter;
16
16
require DynaLoader;
17
17
require AutoLoader;
18
- require 5.003 ;
18
+ require 5.002 ;
19
19
20
20
@ISA = qw( Exporter DynaLoader) ;
21
21
@@ -50,6 +50,7 @@ require 5.003;
50
50
PQfsize
51
51
PQcmdStatus
52
52
PQoidStatus
53
+ PQcmdTuples
53
54
PQgetvalue
54
55
PQgetlength
55
56
PQgetisnull
@@ -83,7 +84,7 @@ require 5.003;
83
84
PGRES_InvalidOid
84
85
) ;
85
86
86
- $VERSION = ' 1.6.1 ' ;
87
+ $Pg:: VERSION = ' 1.6.2 ' ;
87
88
88
89
sub AUTOLOAD {
89
90
# This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -140,7 +141,7 @@ __END__
140
141
141
142
=head1 NAME
142
143
143
- Pg - Perl extension for PostgreSQL
144
+ Pg - Perl5 extension for PostgreSQL
144
145
145
146
146
147
=head1 SYNOPSIS
@@ -194,7 +195,7 @@ to an object goes away.
194
195
=head2 old style
195
196
196
197
All functions and constants are imported into the calling
197
- packages namespace . In order to to get a uniform naming,
198
+ packages name-space . In order to to get a uniform naming,
198
199
all functions start with 'PQ' (e.g. PQlo_open) and all
199
200
constants start with 'PGRES_' (e.g. PGRES_CONNECTION_OK).
200
201
@@ -245,7 +246,7 @@ fields of this structure.
245
246
246
247
Opens a new connection to the backend. You may use an empty string for
247
248
any argument, in which case first the environment is checked and then
248
- hardcoded defaults are used. The connection identifier $conn ( a pointer
249
+ hard-coded defaults are used. The connection identifier $conn ( a pointer
249
250
to the PGconn structure ) must be used in subsequent commands for unique
250
251
identification. Before using $conn you should call $conn->status to ensure,
251
252
that the connection was properly made. Use the methods below to access
@@ -374,7 +375,7 @@ methods you can access almost all fields of this structure.
374
375
375
376
Use the functions below to access the contents of the PGresult structure.
376
377
377
- $ntups = $result->ntuples
378
+ $ntuples = $result->ntuples
378
379
379
380
Returns the number of tuples in the query result.
380
381
@@ -430,13 +431,22 @@ command executed:
430
431
431
432
$cmdStatus = $result->cmdStatus
432
433
433
- Returns the command status of the last query command.
434
+ Returns the command status of the last query command.
435
+ In case of DELETE it returns also the number of deleted tuples.
436
+ In case of INSERT it returns also the OID of the inserted
437
+ tuple followed by 1 (the number of affected tuples).
438
+
434
439
435
440
$oid = $result->oidStatus
436
441
437
442
In case the last query was an INSERT command it returns the oid of the
438
443
inserted tuple.
439
444
445
+ $oid = $result->cmdTuples
446
+
447
+ In case the last query was an INSERT or DELETE command it returns the
448
+ number of affected tuples.
449
+
440
450
$result->printTuples($fout, $printAttName, $terseOutput, $width)
441
451
442
452
Kept for backward compatibility. Use print.
@@ -462,13 +472,13 @@ Frees all memory of the given result.
462
472
463
473
These functions provide file-oriented access to user data.
464
474
The large object interface is modeled after the Unix file
465
- system interface with analogues of open, close, read, write,
475
+ system interface with analogies of open, close, read, write,
466
476
lseek, tell. In order to get a consistent naming, all function
467
477
names have been prepended with 'PQ' (old style only).
468
478
469
479
$lobjId = $conn->lo_creat($mode)
470
480
471
- Creates a new large object. $mode is a bitmask describing
481
+ Creates a new large object. $mode is a bit-mask describing
472
482
different attributes of the new object. Use the following constants:
473
483
474
484
- PGRES_INV_SMGRMASK
@@ -529,6 +539,6 @@ Returns -1 upon failure, 1 otherwise.
529
539
530
540
=head1 SEE ALSO
531
541
532
- libpq(3), large_objects(3).
542
+ L< libpq> , L< large_objects>
533
543
534
544
=cut
0 commit comments