Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL - Unable to convert plaintext field to number #5266

dbrookes opened this issue Nov 25, 2019 · 0 comments


Copy link

@dbrookes dbrookes commented Nov 25, 2019


With PostgreSQL, after creating a plain text field (no data in it) I'm unable to convert it into a number field.

Steps to reproduce

  1. Create plain text field
  2. Immediately try to convert it into a number field
SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "field_ranking" cannot be cast automatically to type integer
HINT: You might need to specify "USING "field_ranking"::integer".
The SQL being executed was: ALTER TABLE "content" ALTER COLUMN "field_ranking" TYPE integer, ALTER COLUMN "field_ranking" DROP DEFAULT, ALTER COLUMN "field_ranking" DROP NOT NULL

Additional info

  • Craft version: Craft Pro 3.3.13
  • PHP version: 7.2
  • Database driver & version: PostgreSQL 10.11
  • Plugins & versions:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.