Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 227688 - Attribute type error when updating varchar column
Summary: Attribute type error when updating varchar column
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: postgresql
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Tom Lane
QA Contact: David Lawrence
Depends On: 227522
Blocks: 225496
TreeView+ depends on / blocked
Reported: 2007-02-07 16:11 UTC by Tom Lane
Modified: 2013-07-03 03:12 UTC (History)
2 users (show)

Fixed In Version: RHSA-2007-0068
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-03-14 15:02:43 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2007:0068 normal SHIPPED_LIVE Moderate: postgresql security update 2007-03-14 15:01:54 UTC

Description Tom Lane 2007-02-07 16:11:39 UTC
+++ This bug was initially created as a clone of Bug #227522 +++

Description of problem:

In a table with a varchar column and a check constraint, updating that column
gives "ERROR:  attribute 1 has wrong type".

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

> createdb testdb

> psql testdb
Welcome to psql 8.1.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

testdb=> create table t (pa_status varchar(100));

testdb=> alter table t add constraint rhpt_projects_pa_status_ck check
(pa_status = 'submitted' or pa_status = 'approved' or pa_status = 'closed');

testdb=> insert into t values ('approved');

testdb=> update t set pa_status = 'approved';
ERROR:  attribute 1 has wrong type
DETAIL:  Table has type character varying, but query expects character varying.

Actual results:

Error, update fails

Expected results:

Update should work

Additional info:

This worked with the previous FC6 version of PostgreSQL.

-- Additional comment from on 2007-02-06 13:18 EST --
Yeah, it's broken :-( ... there'll be an 8.1.8 real soon now ...

Comment 1 Tom Lane 2007-02-07 16:18:19 UTC
This problem also affects our initial attempt to fix bug #225496 in RHEL5 --- it's actually caused by the 
security fix, which was being too strict about type matching.  Security team, please flag this bug as 
approved for rhel-5.1.0 ...

Comment 5 Red Hat Bugzilla 2007-03-14 15:02:43 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.