Port Bug Report: UPDATE reports successful but was not

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: UPDATE reports successful but was not
Date: 1999-04-26 21:23:00
Message-ID: 199904262123.RAA80125@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Cody Zilverberg
Your email address : cjzilverberg(at)csbsju(dot)edu

Category : runtime: back-end: SQL
Severity : serious

Summary: UPDATE reports successful but was not

System Configuration
--------------------
Operating System : Irix

PostgreSQL version : 6.3

Compiler used :

Hardware:
---------

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
I created a table with 7 columns and I later added an
eighth column. When I try to update that column, PostgreSQL
reports a successful update, but fails it update the eight
column. This occurs whether I try to update a row or if I
try to insert a new row.

--------------------------------------------------------------------------

Test Case:
----------
I have a class that looks like the following. I put all of the columns in it
when I created it, except for instructorid, which I added later.

Table = class
+----------------------------------+----------------------------------+-------+
| Field | Type | Length|
+----------------------------------+----------------------------------+-------+
| classid | int4 default nextval ( 'class_cl | 4 |
| department | varchar() | 10 |
| classname | varchar() | 25 |
| section | varchar() | 5 |
| coursenumber | varchar() | 4 |
| term | varchar() | 1 |
| year | varchar() | 4 |
| instructorid | int4 | 4 |
+----------------------------------+----------------------------------+-------+

The table's current state is this.

homework=> select * from class;
classid|department|classname |section|coursenumber|term|year|instructorid
-------+----------+---------------+-------+------------+----+----+------------
1|CS |Data Structures|001a | 200| 4|1998|
2|Bio |Anatomy |001a | 130| 2|1997|
3|Bio |Anatomy |001a | 130| 2|1996|
(3 rows)

I issue this successful command:

homework=> update class set instructorid=333 where classid=3;
UPDATE 1

and the state of the table is:

homework=> select * from class;
classid|department|classname |section|coursenumber|term|year|instructorid
-------+----------+---------------+-------+------------+----+----+------------
1|CS |Data Structures|001a | 200| 4|1998|
2|Bio |Anatomy |001a | 130| 2|1997|
3|Bio |Anatomy |001a | 130| 2|1996|
(3 rows)

homework=> select * from class where instructorid=333;
classid|department|classname|section|coursenumber|term|year|instructorid
-------+----------+---------+-------+------------+----+----+------------
(0 rows)

For some reason the instructorid is not updated. Similarly, if I try to insert
a new row, all of the new values are inserted successfully except for the
instructorid value.

--------------------------------------------------------------------------

Solution:
---------

--------------------------------------------------------------------------

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Bruce Momjian 1999-04-26 22:43:53 Re: [PORTS] Port Bug Report: UPDATE reports successful but was not
Previous Message Thomas Lockhart 1999-04-26 17:04:05 [Fwd: Returned mail: User unknown]