Default constraint does not work for float and boolean
See original GitHub issuestatus {
abc as boolean <DEFAULT true>
}
Leads to error: Line 10 - This constraint value must be of a Short
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Specify Default Values for Columns - SQL Server
You can use SQL Server Management Studio to specify a default value that will be entered into the table column. You can set...
Read more >Default Value Constraint | CockroachDB Docs
The Default Value constraint specifies a value to populate a column with if none is provided.
Read more >Postgres Alter Column Integer to Boolean
Try this: ALTER TABLE mytabe ALTER COLUMN mycolumn DROP DEFAULT; ALTER TABLE mytabe ALTER mycolumn TYPE bool USING CASE WHEN mycolumn=0 THEN FALSE...
Read more >Default Column Values in JPA
When we take a look at the SQL table definition, we won't see any default value in it: create table user ( id...
Read more >DEFAULT clause of CREATE TABLE
If you specify no default value for a column, the default is NULL unless you place a NOT NULL constraint on the column....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It gets weirder.
foo as float <DEFAULT 0.0>--> okfoo as float <DEFAULT 0.1>--> okfoo as float <DEFAULT 1.0>-->no viable alternative at input '1.0'¯_(ツ)_/¯foo as float <DEFAULT 2.0>--> ok again…Also worth noting the parsing error messages are different in case of boolean vs float.
boo as boolean <DEFAULT true>-->This constraint value must be of a ShortProbably different issues in the grammar.
Closing this and #2490 since it’s merged.