PostgreSQL: Impossible to change a field to serial, bigserial, or numeric

Created on 2 July 2012, almost 12 years ago
Updated 23 May 2024, about 1 month ago

When upgrading a field / changing it's type using pgsql:changeField, it's impossible to make a field a serial, bigserial, or numeric. This appears to be because of confusion between the typecast that is required to do the data-conversion and the field-type we are creating. As is currently stands, pgsql:changeField() is forcing serial, bigserial, or numeric to be int.

We found this issue because of this contrib issue: πŸ› Field type update fails in PostgreSQL Active

Related to this, is that there should better logic around when we need to force explicit casting with a USING statement. It's not always required, and we shouldn't use it unless we need to.

πŸ› Bug report
Status

RTBC

Version

7.0 ⚰️

Component
PostgreSQL driverΒ  β†’

Last updated 4 days ago

No maintainer
Created by

πŸ‡¨πŸ‡¦Canada phayes

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand RoSk0 Wellington

    Thank you for the hard work Team! I couldn't tell how happy I am that this time it's not on me to debug another PostgreSQL bug!

    Tested patch from #59 on a pretty sizable project that is using geofield module and where upgrade to the latest 2.5 version was blocked by this bug.

    Works like a charm! Let's get this committed.

  • πŸ‡³πŸ‡ΏNew Zealand RoSk0 Wellington

    Tested on PostgreSQL 12.

Production build 0.69.0 2024