Re: Updates failing yet saying they succeeded. - Mailing list pgsql-general

From Gregory Seidman
Subject Re: Updates failing yet saying they succeeded.
Date
Msg-id 20020604052012.GA14972@jamaica.cs.brown.edu
Whole thread Raw
In response to Updates failing yet saying they succeeded.  (Oliver Jones <oliver@deeper.co.nz>)
List 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: View vs. Statement Query Plan
Next
From: Tom Lane
Date:
Subject: Re: Updates failing yet saying they succeeded.