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 227522 - Attribute type error when updating varchar column
Summary: Attribute type error when updating varchar column
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 227542 227688
TreeView+ depends on / blocked
 
Reported: 2007-02-06 17:04 UTC by Carsten Clasohm
Modified: 2013-07-03 03:12 UTC (History)
1 user (show)

Fixed In Version: postgresql-8.1.8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-02-08 20:23:09 UTC


Attachments (Terms of Use)

Description Carsten Clasohm 2007-02-06 17:04:28 UTC
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.

Comment 1 Tom Lane 2007-02-06 18:18:02 UTC
Yeah, it's broken :-( ... there'll be an 8.1.8 real soon now ...


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