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

Commit c5d4990

Browse files
Edmund MerglEdmund Mergl
Edmund Mergl
authored and
Edmund Mergl
committed
*** empty log message ***
1 parent 4a98c57 commit c5d4990

File tree

10 files changed

+67
-43
lines changed

10 files changed

+67
-43
lines changed

src/interfaces/perl5/Changes

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Revision history for Perl extension Pg.
22

3+
1.6.3 Sep 25 1997
4+
- README update
5+
36
1.6.2 Sep 20 1997
4-
- adapted to PostgresqL-6.2:
7+
- adapted to PostgreSQL-6.2:
58
o added support for new method cmdTuples
69
o cmdStatus returns now for DELETE the status
710
followed by the number of affected rows,

src/interfaces/perl5/Makefile.PL

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: Makefile.PL,v 1.3 1997/09/17 20:46:20 mergl Exp $
3+
# $Id: Makefile.PL,v 1.4 1997/09/25 21:14:41 mergl Exp $
44
#
55
# Copyright (c) 1997 Edmund Mergl
66
#
77
#-------------------------------------------------------
88

99
use ExtUtils::MakeMaker;
10+
use Config;
11+
use strict;
1012

1113
print "\nConfiguring Pg\n";
1214
print "Remember to actually read the README file !\n";
13-
die "\nYou didn't read the README file !\n" unless ($] >= 5.003);
15+
die "\nYou didn't read the README file !\n" unless ($] >= 5.002);
1416

1517
if (! $ENV{POSTGRES_HOME}) {
1618
warn "\$POSTGRES_HOME not defined. Searching for PostgreSQL...\n";
17-
foreach(qw(/usr/pgsql /usr/local/pgsql /usr/pgsql-6.1 /usr/local/pgsql-6.1)) {
19+
foreach(qw(/usr/local/pgsql /usr/pgsql /home/pgsql /opt/pgsql /usr/local/postgres /usr/postgres /home/postgres /opt/postgres)) {
1820
if (-d "$_/lib") {
1921
$ENV{POSTGRES_HOME} = $_;
2022
last;
2123
}
2224
}
2325
}
2426

25-
if ($ENV{POSTGRES_HOME}) {
26-
print "\nFound PostgreSQL in $ENV{POSTGRES_HOME}\n";
27+
if (-d "$ENV{POSTGRES_HOME}/lib") {
28+
print "Found PostgreSQL in $ENV{POSTGRES_HOME}\n";
2729
} else {
28-
die "Unable to determine \$POSTGRES_HOME !\n";
30+
die "Unable to determine PostgreSQL\n";
2931
}
3032

31-
WriteMakefile(
32-
'NAME' => 'Pg',
33-
'VERSION_FROM' => 'Pg.pm',
34-
'LIBS' => ["-L$ENV{POSTGRES_HOME}/lib -lpq"],
35-
'INC' => "-I$ENV{POSTGRES_HOME}/include",
33+
my %opts = (
34+
NAME => 'Pg',
35+
VERSION_FROM => 'Pg.pm',
36+
INC => "-I$ENV{POSTGRES_HOME}/include",
37+
LIBS => ["-L$ENV{POSTGRES_HOME}/lib -lpq"],
3638
);
3739

38-
# EOF
40+
41+
WriteMakefile(%opts);
42+
43+
exit(0);
44+
45+
# end of Makefile.PL

src/interfaces/perl5/Pg.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: Pg.pm,v 1.3 1997/09/17 20:46:21 mergl Exp $
3+
# $Id: Pg.pm,v 1.4 1997/09/25 21:14:43 mergl Exp $
44
#
55
# Copyright (c) 1997 Edmund Mergl
66
#
@@ -84,7 +84,7 @@ require 5.002;
8484
PGRES_InvalidOid
8585
);
8686

87-
$Pg::VERSION = '1.6.2';
87+
$Pg::VERSION = '1.6.3';
8888

8989
sub AUTOLOAD {
9090
# This AUTOLOAD is used to 'autoload' constants from the constant()

src/interfaces/perl5/Pg.xs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-------------------------------------------------------
22
*
3-
* $Id: Pg.xs,v 1.3 1997/09/17 20:46:21 mergl Exp $
3+
* $Id: Pg.xs,v 1.4 1997/09/25 21:14:44 mergl Exp $
44
*
55
* Copyright (c) 1997 Edmund Mergl
66
*

src/interfaces/perl5/README

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: README,v 1.3 1997/09/17 20:46:26 mergl Exp $
3+
# $Id: README,v 1.4 1997/09/25 21:14:46 mergl Exp $
44
#
55
# Copyright (c) 1997 Edmund Mergl
66
#
@@ -9,7 +9,7 @@
99
DESCRIPTION:
1010
------------
1111

12-
This is version 1.6.2 of pgsql_perl5 (previously called pg95perl5).
12+
This is version 1.6.3 of pgsql_perl5 (previously called pg95perl5).
1313

1414
Pgsql_perl5 is an interface between Larry Wall's language perl version 5 and
1515
the database PostgreSQL (previously Postgres95). This has been done by using
@@ -85,14 +85,17 @@ Run 'make test'.
8585
Note, that the user running this script must have been created with the access
8686
rights to create databases *AND* users ! Do not run this script as root !
8787

88-
If you are using the shared library libpq.so, make sure, your dynamic loader
89-
is able to find libpq.so. With Linux the command /sbin/ldconfig -v should tell
90-
you, where it finds libpq.so. If not, you need to add an appropriate entry to
91-
/etc/ld.so.conf or to the environment variable LD_LIBRARY_PATH.
88+
If you are using the shared library libpq.so check if your dynamic loader
89+
finds libpq.so. With Linux the command /sbin/ldconfig -v should tell you,
90+
where it finds libpq.so. If ldconfig does not find libpq.so, either add an
91+
appropriate entry to /etc/ld.so.conf and re-run ldconfig or add the path to
92+
the environment variable LD_LIBRARY_PATH.
93+
A typical error message resulting from not finding libpq.so is:
94+
Can't load './blib/arch/auto/Pg/Pg.so' for module Pg: File not found at
9295

9396
Some linux distributions have an incomplete perl installation.
9497
If you have compile errors like "XS_VERSION_BOOTCHECK undeclared", make a
95-
'find /usr/lib/perl5 -name XSUB.h -print'
98+
'find .../lib/perl5 -name XSUB.h -print'
9699
If this file is not present, you need to recompile and reinstall perl.
97100

98101

@@ -105,6 +108,6 @@ installation to read the documentation.
105108

106109
---------------------------------------------------------------------------
107110

108-
Edmund Mergl <E.Mergl@bawue.de> September 20, 1997
111+
Edmund Mergl <E.Mergl@bawue.de> September 25, 1997
109112

110113
---------------------------------------------------------------------------

src/interfaces/perl5/eg/ApachePg.pl

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# - PostgreSQL-6.2
55
# - apache_1.2.4
66
# - mod_perl-1.00
7-
# - perl5.004_01
7+
# - perl5.004_03
88

99
use CGI;
1010
use Pg;
@@ -30,7 +30,15 @@
3030
$conn = Pg::connectdb("dbname = $dbname");
3131
$cmd = $query->param('cmd');
3232
$result = $conn->exec($cmd);
33-
$result->print(STDOUT, 0, 0, 0, 1, 0, 0, '', '', '');
33+
print "<TABLE>";
34+
for ($i = 0; $i < $result->ntuples; $i++) {
35+
print "<TR>";
36+
for ($j = 0; $j < $result->nfields; $j++) {
37+
print "<TD>", $result->getvalue($i, $j), "</TD>";
38+
}
39+
print "</TR>";
40+
}
41+
print "</TABLE>";
3442
}
3543

3644
print $query->end_html;

src/interfaces/perl5/eg/example.newstyle

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/local/bin/perl
1+
#!/usr/local/bin/perl -w
22

33
#-------------------------------------------------------
44
#
5-
# $Id: example.newstyle,v 1.1 1997/09/17 20:48:14 mergl Exp $
5+
# $Id: example.newstyle,v 1.2 1997/09/25 21:15:02 mergl Exp $
66
#
77
# Copyright (c) 1997 Edmund Mergl
88
#
@@ -88,7 +88,7 @@ $SIG{PIPE} = sub { print "broken pipe\n" };
8888
######################### create and connect to test database
8989
# 2-4
9090

91-
$conn = Pg::connectdb("dbname = $dbmain");
91+
$conn = Pg::connectdb("dbname=$dbmain");
9292
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
9393

9494
# might fail if $dbname doesn't exist => don't check resultStatus
@@ -97,7 +97,7 @@ $result = $conn->exec("DROP DATABASE $dbname");
9797
$result = $conn->exec("CREATE DATABASE $dbname");
9898
cmp_eq(PGRES_COMMAND_OK, $result->resultStatus);
9999

100-
$conn = Pg::connectdb("dbname = $dbname");
100+
$conn = Pg::connectdb("dbname=$dbname");
101101
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
102102

103103
######################### debug, PQtrace
@@ -141,7 +141,8 @@ for ($i = 1; $i <= 5; $i++) {
141141
$result = $conn->exec("COPY person TO STDOUT");
142142
cmp_eq(PGRES_COPY_OUT, $result->resultStatus);
143143

144-
$i = 1;
144+
$i = 1;
145+
$ret = 0;
145146
while (-1 != $ret) {
146147
$ret = $conn->getline($string, 256);
147148
last if $string eq "\\.";
@@ -217,7 +218,7 @@ if (! defined($pid = fork)) {
217218
# i'm the child
218219
sleep 2;
219220
bless $conn;
220-
$conn = Pg::connectdb("dbname = $dbname");
221+
$conn = Pg::connectdb("dbname=$dbname");
221222
$result = $conn->exec("NOTIFY person");
222223
exit;
223224
}
@@ -277,7 +278,7 @@ if ($DEBUG) {
277278
######################### disconnect and drop test database
278279
# 60-61
279280

280-
$conn = Pg::connectdb("dbname = $dbmain");
281+
$conn = Pg::connectdb("dbname=$dbmain");
281282
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
282283

283284
$result = $conn->exec("DROP DATABASE $dbname");

src/interfaces/perl5/eg/example.oldstyle

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/local/bin/perl
1+
#!/usr/local/bin/perl -w
22

33
#-------------------------------------------------------
44
#
5-
# $Id: example.oldstyle,v 1.1 1997/09/17 20:48:15 mergl Exp $
5+
# $Id: example.oldstyle,v 1.2 1997/09/25 21:15:04 mergl Exp $
66
#
77
# Copyright (c) 1997 Edmund Mergl
88
#
@@ -148,7 +148,8 @@ $result = PQexec($conn, "COPY person TO STDOUT");
148148
cmp_eq(PGRES_COPY_OUT, PQresultStatus($result));
149149
PQclear($result);
150150

151-
$i = 1;
151+
$i = 1;
152+
$ret = 0;
152153
while (-1 != $ret) {
153154
$ret = PQgetline($conn, $string, 256);
154155
last if $string eq "\\.";

src/interfaces/perl5/test.pl

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/local/bin/perl
1+
#!/usr/local/bin/perl -w
22

33
#-------------------------------------------------------
44
#
5-
# $Id: test.pl,v 1.4 1997/09/17 20:53:35 mergl Exp $
5+
# $Id: test.pl,v 1.5 1997/09/25 21:14:47 mergl Exp $
66
#
77
# Copyright (c) 1997 Edmund Mergl
88
#
@@ -88,7 +88,7 @@
8888
######################### create and connect to test database
8989
# 2-4
9090

91-
$conn = Pg::connectdb("dbname = $dbmain");
91+
$conn = Pg::connectdb("dbname=$dbmain");
9292
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
9393

9494
# might fail if $dbname doesn't exist => don't check resultStatus
@@ -97,7 +97,7 @@
9797
$result = $conn->exec("CREATE DATABASE $dbname");
9898
cmp_eq(PGRES_COMMAND_OK, $result->resultStatus);
9999

100-
$conn = Pg::connectdb("dbname = $dbname");
100+
$conn = Pg::connectdb("dbname=$dbname");
101101
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
102102

103103
######################### debug, PQtrace
@@ -141,7 +141,8 @@
141141
$result = $conn->exec("COPY person TO STDOUT");
142142
cmp_eq(PGRES_COPY_OUT, $result->resultStatus);
143143

144-
$i = 1;
144+
$i = 1;
145+
$ret = 0;
145146
while (-1 != $ret) {
146147
$ret = $conn->getline($string, 256);
147148
last if $string eq "\\.";
@@ -218,7 +219,7 @@
218219
######################### disconnect and drop test database
219220
# 49-50
220221

221-
$conn = Pg::connectdb("dbname = $dbmain");
222+
$conn = Pg::connectdb("dbname=$dbmain");
222223
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
223224

224225
$result = $conn->exec("DROP DATABASE $dbname");

src/interfaces/perl5/typemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#-------------------------------------------------------
22
#
3-
# $Id: typemap,v 1.3 1997/09/17 20:46:29 mergl Exp $
3+
# $Id: typemap,v 1.4 1997/09/25 21:14:49 mergl Exp $
44
#
55
# Copyright (c) 1997 Edmund Mergl
66
#

0 commit comments

Comments
 (0)