Re: Updates failing yet saying they succeeded.

From: Gregory Seidman <gss+pg(at)cs(dot)brown(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Updates failing yet saying they succeeded.
Date: 2002-06-04 05:20:12
Message-ID: 20020604052012.GA14972@jamaica.cs.brown.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It looks like it's doing exactly what you are asking. Observe:

Oliver Jones sez:
} I've been having a few problems with PgSQL not updateing data
} correctly. Here is some evidence:
}
} autosupply_co_jp=> update vehicle set fob_price =420000 where
} chassis_number
} autosupply_co_jp-> = 'RA2-1002998';
} UPDATE 1

Okay, updating RA2-1002998...

} autosupply_co_jp=> select fob_price from vehicle where chassis_number =
} 'RA2-1042998';
} fob_price
} -----------
} 430000
} (1 row)

...but selecting on RA2-1042998.

} autosupply_co_jp=> update vehicle set fob_price = 420000 where
} chassis_number = 'RA2-1042998';
} UPDATE 1

This time, updating on RA2-1042998...

} autosupply_co_jp=> select fob_price from vehicle where chassis_number =
} 'RA2-1042998';
} fob_price
} -----------
} 420000
} (1 row)

...and selecting on the same, RA2-1042998.

} WTF is up with that?

It didn't work the first time because you were not selecting the same thing
you'd updated. Pilot error.

[...]
} Oliver Jones > Software Engineer >
--Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-06-04 05:22:54 Re: Updates failing yet saying they succeeded.
Previous Message Tom Lane 2002-06-04 05:15:38 Re: View vs. Statement Query Plan