aboutsummaryrefslogtreecommitdiff
path: root/databases/p5-DBD-Pg/files
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2003-08-11 19:47:38 +0000
committerMax Khon <fjoe@FreeBSD.org>2003-08-11 19:47:38 +0000
commitce79f1753391125f42df267cd99dce9393b98c8e (patch)
tree3a9fa3c79fe29f91281e26b9e9d53fbfb20fe422 /databases/p5-DBD-Pg/files
parent17a2b8c800cc0114a1dbf59be950b01249e568d6 (diff)
downloadports-ce79f1753391125f42df267cd99dce9393b98c8e.tar.gz
ports-ce79f1753391125f42df267cd99dce9393b98c8e.zip
Notes
Diffstat (limited to 'databases/p5-DBD-Pg/files')
-rw-r--r--databases/p5-DBD-Pg/files/patch-Pg.pm60
1 files changed, 60 insertions, 0 deletions
diff --git a/databases/p5-DBD-Pg/files/patch-Pg.pm b/databases/p5-DBD-Pg/files/patch-Pg.pm
new file mode 100644
index 000000000000..0420d22effb1
--- /dev/null
+++ b/databases/p5-DBD-Pg/files/patch-Pg.pm
@@ -0,0 +1,60 @@
+--- ./Pg.pm.orig Tue Aug 12 02:03:06 2003
++++ ./Pg.pm Tue Aug 12 02:31:41 2003
+@@ -70,8 +70,8 @@
+ sub pg_use_catalog {
+ my $dbh = shift;
+ my $version = DBD::Pg::pg_server_version($dbh);
+- $version =~ /^(\d+\.\d+)/;
+- return $1 < 7.3 ? "" : "pg_catalog.";
++ $version =~ s/^(\d+\.\d+).*/\1/;
++ return $version < 7.3 ? "" : "pg_catalog.";
+ }
+
+ 1;
+@@ -200,6 +200,7 @@
+ my $wh = ""; # ();
+ $wh = join( " AND ", '', @wh ) if (@wh);
+ my $version = DBD::Pg::pg_server_version($dbh);
++ $version =~ s/^(\d+\.\d+).*/\1/;
+ my $showschema = $version < 7.3 ? "NULL::text" : "n.nspname";
+ my $schemajoin = $version < 7.3 ? "" : "LEFT JOIN pg_catalog.pg_namespace n ON (n.oid = c.relnamespace)";
+ my $col_info_sql = qq{
+@@ -258,10 +259,10 @@
+ my @wh = (); my @dat = (); # Used to hold data for the attributes.
+
+ my $version = DBD::Pg::pg_server_version($dbh);
+- $version =~ /^(\d+)\.(\d)/;
++ $version =~ s/^(\d+\.\d+).*/\1/;
+
+ my @flds = qw/catname u.usename bc.relname/;
+- $flds[1] = 'n.nspname' unless ($1.$2 < 73);
++ $flds[1] = 'n.nspname' unless ($version < 7.3);
+
+ for my $idx (0 .. $#attrs) {
+ next if ($flds[$idx] eq 'catname'); # Skip catalog
+@@ -600,6 +601,7 @@
+ my $tbl_sql = ();
+
+ my $version = DBD::Pg::pg_server_version($dbh);
++ $version =~ s/^(\d+\.\d+).*/\1/;
+ my $CATALOG = DBD::Pg::pg_use_catalog($dbh);
+
+ if ( # Rules 19a
+@@ -804,6 +806,7 @@
+ sub tables {
+ my($dbh) = @_;
+ my $version = DBD::Pg::pg_server_version($dbh);
++ $version =~ s/^(\d+\.\d+).*/\1/;
+
+ my $SQL = ($version < 7.3) ?
+ "SELECT relname AS \"TABLE_NAME\"
+@@ -908,7 +911,8 @@
+ # by pg_constraint. To maintain compatibility, check
+ # version number and execute appropriate query.
+
+- my $version = pg_server_version( $dbh );
++ my $version = DBD::Pg::pg_server_version( $dbh );
++ $version =~ s/^(\d+\.\d+).*/\1/;
+
+ my $con_query = $version < 7.3
+ ? "SELECT rcsrc FROM pg_relcheck WHERE rcname = '${table}_$col_name'"