From 5844e91910ea6e0786e8a5664c2a8d3b2cd6c79b Mon Sep 17 00:00:00 2001 From: chriskl Date: Sun, 16 May 2004 14:34:44 +0000 Subject: [PATCH] fix display of array types in 7.0.x --- HISTORY | 1 + classes/database/Postgres.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index 4cea23a6..ede1d8db 100644 --- a/HISTORY +++ b/HISTORY @@ -38,6 +38,7 @@ Features Bugs * Fix pg_dump output for PostgreSQL 7.0.x and 7.1.x * In 7.4 pg_dump, specify schema when dumping tables +* Fix bug in displaying array types in 7.0.x Version 3.3.1 ------------- diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index e218c86c..96bb6892 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres.php,v 1.205 2004/05/16 09:35:28 chriskl Exp $ + * $Id: Postgres.php,v 1.206 2004/05/16 14:34:44 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -1056,6 +1056,13 @@ class Postgres extends BaseDB { // This is a specific constant in the 7.0 source $varhdrsz = 4; + // If the first character is an underscore, it's an array type + $is_array = false; + if (substr($typname, 0, 1) == '_') { + $is_array = true; + $typname = substr($typname, 1); + } + // Show lengths on bpchar and varchar if ($typname == 'bpchar') { $len = $typmod - $varhdrsz; @@ -1079,6 +1086,9 @@ class Postgres extends BaseDB { } else $temp = $typname; + // Add array qualifier if it's an array + if ($is_array) $temp .= '[]'; + return $temp; } -- 2.39.5