From:             n dot j dot saunders at gmail dot com
Operating system: Windows XP
PHP version:      5.0.5
PHP Bug Type:     PostgreSQL related
Bug description:  pg_update fails

Description:
------------
pg_update seems to fail when updating an columns of a user defined
domain.

I have inherited table (advertisers) that contains, among others, the
columns telephone_country (integer), telephone_area (area domain),
telephone_number (number domain).

pg_update succeeds when VARCHAR fields are updated, but seems to fail
without error when fields of user defined domains are updated from the
array 

Reproduce code:
---------------
1. Define a Domain in an existing postgres database

e.g: area_code, domain with check

CREATE DOMAIN "public"."area_code" AS
  varchar(10) NULL;

ALTER DOMAIN "public"."area_code"
  ADD CONSTRAINT "ck_area_code" CHECK ((VALUE)::text ~
'^\\(?[0-9]\\)?[0-9]*$'::text);

2. Define a table in a postgres database that includes a column of the
type you just created.

CREATE TABLE "public"."users" (
  "username" VARCHAR(20) NOT NULL, 
  "altphone_area" "public"."area_code);

3. Create a record in the table

INSERT INTO users (username, altphone_area) VALUES ('Neil',222);

3. Try and use pg_update to update this record

pg_update($db, "users", array('altphone_area'=>444),
array('username'=>'Neil'));

Expected result:
----------------
The record you created is updated, setting the value of altphone_area=444

Actual result:
--------------
Nothing. No updates, no error messages.

-- 
Edit bug report at http://bugs.php.net/?id=34920&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34920&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34920&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34920&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34920&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34920&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34920&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34920&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34920&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34920&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34920&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34920&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34920&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34920&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34920&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34920&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34920&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34920&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34920&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34920&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34920&r=mysqlcfg

Reply via email to