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


Your name : Cody Zilverberg
Your email address : cjzilverberg@csbsju.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:
---------


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

Search Discussions

  • Bruce Momjian at Apr 26, 1999 at 11:02 pm

    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.

    This was fixed in 6.4, or perhaps in 6.5beta, but I know it has been
    fixed.

    --
    Bruce Momjian | http://www.op.net/~candle
    maillist@candle.pha.pa.us | (610) 853-3000
    + If your life is a hard drive, | 830 Blythe Avenue
    + Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-ports @
categoriespostgresql
postedApr 26, '99 at 9:23p
activeApr 26, '99 at 11:02p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Cody Zilverberg: 1 post Bruce Momjian: 1 post

People

Translate

site design / logo © 2022 Grokbase