|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-08 09:19 UTC] hirokawa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 12:00:01 2025 UTC |
Ok, - the patch below is probably buggered up.. - but the principle is that you need to add AND f.attnum = a.adnum to the end of the get default value query otherwise any rows with defaults will get the same value as the first one. Index: DB/pgsql.php =================================================================== RCS file: /repository/pear/DB/DB/pgsql.php,v retrieving revision 1.17 diff -u -r1.17 pgsql.php --- DB/pgsql.php 14 Feb 2003 11:02:00 -0000 1.17 +++ DB/pgsql.php 27 Mar 2003 05:24:39 -0000 @@ -606,7 +606,7 @@ FROM pg_attribute f, pg_class tab, pg_type typ, pg_attrdef a WHERE tab.relname = typ.typname AND typ.typrelid = f.attrelid AND f.attrelid = a.adrelid AND f.attname = '$field_name' - AND tab.relname = '$table_name'"); + AND tab.relname = '$table_name' AND f.attnum = a.adnum"); $row = @pg_fetch_row($result, 0); $num = str_replace('\'', '', $row[0]);