PostgreSQL migrations - default values in double quotes #859

radeczo opened this Issue Sep 27, 2016 · 1 comment


None yet

2 participants

radeczo commented Sep 27, 2016 edited


Phalcon DevTools (3.0.0)

Default values in PostgreSQL should be in single quotes (for strings) or as an number (for int, bigint, etc.). Double quoted values Postgres interprets as column names.

Error example:

Column definition:

new Column(
        'type' => Column::TYPE_INTEGER,
        'default' => "1",
        'after' => 'order'

Generated SQL:

CREATE TABLE "public"."table" (
    "status" INT DEFAULT "1",

Postgres error:
ERROR: SQLSTATE[42703]: Undefined column: 7 ERROR: column "1" does not exist



I've fixed this issue in the Phalcon 3.0.x branch. You need to update Phalcon:

git clone
cd cphalcon
git checkout 3.0.x

zephir fullclean
zephir build

Thank you for contributing!

@sergeyklay sergeyklay closed this Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment