Open nmk opened 8 years ago
This is likely a quoting or capitalization problem. Two ways of debugging this are:
It turns out in PostgreSQL timestamp
and timestamp without time zone
are synonyms and the udt_name
of such a column is reported simply as timestamp
, see first note on http://www.postgresql.org/docs/current/static/datatype-datetime.html. So one option is to define the sqltype=
as timestamp
, the other is to add an alias in sqlShowType
such as
showSqlType (SqlOther (T.toLower -> "timestamp")) = "TIMESTAMP WITHOUT TIME ZONE"
in Database.Persist.Postgresql.
The latter seems like it could cause problems for people using timestamp right now. I'd recommend changing your schema to use timestamp instead.
On Wed, Dec 9, 2015, 12:50 PM Nickolay Kolev notifications@github.com wrote:
It turns out in PostgreSQL timestamp and timestamp without time zone are synonyms and the udt_name of such a column is reported simply as timestamp, see first note on http://www.postgresql.org/docs/current/static/datatype-datetime.html. So one option is to define the sqltype= as timestamp, the other is to add an alias in sqlShowType such as
showSqlType (SqlOther (T.toLower -> "timestamp")) = "TIMESTAMP WITHOUT TIME ZONE"
in Database.Persist.Postgresql.
— Reply to this email directly or view it on GitHub https://github.com/yesodweb/persistent/issues/514#issuecomment-163187026 .
When using persistent with PostgreSQL and having the following definition
causes a
every time the migrations are run. The type of the field in the DB is set correctly the first time, I would expect it not to issue an
ALTER
statement every time.Is this a (quoting?) problem with my field definition or is persistent not getting the correct column type when calculating the necessary migrations?