Bug 227542 - Attribute type error when updating varchar column
Attribute type error when updating varchar column
Status: CLOSED ERRATA
Product: Red Hat Web Application Stack
Classification: Retired
Component: postgresql (Show other bugs)
v1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
Gurhan Ozen
:
Depends On: 227522
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-06 14:34 EST by Tom Lane
Modified: 2013-11-03 20:32 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2007-0067
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-07 13:31:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom Lane 2007-02-06 14:34:10 EST
+++ 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):

postgresql-8.1.7-1.fc6

How reproducible:

always

Steps to Reproduce:

> createdb testdb
CREATE DATABASE

> 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));
CREATE TABLE

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

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

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 tgl@redhat.com 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-06 21:36:17 EST
postgresql-8.1.7-3.el4s1.1 contains the upstream fix for this.  (If we weren't overdue to release a security 
update, I'd wait for upstream 8.1.8, but we're overdue...)
Comment 4 Red Hat Bugzilla 2007-02-07 13:31:30 EST
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.

http://rhn.redhat.com/errata/RHSA-2007-0067.html

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