[DBD::Pg 1/2] Use %col_map instead of literal indexes in column_info

dbdpg-commits-gENoVmVU/[email protected] Sun, 1 Mar 2015 16:46:26 +0000
Newsgroups gmane.comp.db.postgresql.dbdpg.cvs
Message-ID <[email protected]>
Committed by =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <[email protected]>

Subject: [DBD::Pg 1/2] Use %col_map instead of literal indexes in column_info

---
 Pg.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Pg.pm b/Pg.pm
index efe151a..63e2820 100644
--- a/Pg.pm
+++ b/Pg.pm
@@ -540,18 +540,18 @@ use 5.008001;
 				qq{conrelid = $aid AND conkey = '{$attnum}'};
 			my $info = $dbh->selectall_arrayref($SQL);
 			if (@$info) {
-				$row->[19] = $info->[0][0];
+				$row->[$col_map{pg_constraint}] = $info->[0][0];
 			}
 			else {
-				$row->[19] = undef;
+				$row->[$col_map{pg_constraint}] = undef;
 			}
 
 			if ( $typtype eq 'e' ) {
 				$SQL = "SELECT enumlabel FROM pg_catalog.pg_enum WHERE enumtypid = $typoid ORDER BY oid";
-				$row->[23] = $dbh->selectcol_arrayref($SQL);
+				$row->[$col_map{pg_enum_values}] = $dbh->selectcol_arrayref($SQL);
 			}
 			else {
-				$row->[23] = undef;
+				$row->[$col_map{pg_enum_values}] = undef;
 			}
 		}
 
-- 
1.8.4