JakeWheat / simple-sql-parser

SQL parser in Haskell
http://jakewheat.github.io/simple-sql-parser/latest
Other
82 stars 27 forks source link

postgres types int4, float8 are not supported #32

Open yaitskov opened 3 years ago

yaitskov commented 3 years ago

Hi,

parseStatement v0.6.0 fails for

SELECT  CAST(42 AS int4) from t;
SELECT  CAST(42 AS float8) from t;

but float8 is a valid type in postgres 9.5 https://www.postgresql.org/docs/9.5/datatype.html

JakeWheat commented 2 years ago

Thanks for the report, I would be happy to merge a pull request. I didn't check the code, but it shouldn't even restrict the type name in a cast expression to known types, since you should also be able to cast to user defined types which have arbitrary names.