hssqlppp icon indicating copy to clipboard operation
hssqlppp copied to clipboard

Explicit type signatures fail to parse

Open nikita-volkov opened this issue 6 years ago • 2 comments

E.g.,

> parseQueryExpr defaultParseFlags "" Nothing "select 'a' :: text"
Left (line 1, column 12):
unexpected (("",1,12),Symbol ":")
expecting operator or end of input
cannot make functioncall from StringLit (Annotation {anSrc = Just ("",1,8), anType = Nothing, anErrs = [], anImplicitCast = Nothing, anCatUpd = []}) "a"
:1:12:

Context:
select 'a' :: text
           ^
      ERROR HERE

nikita-volkov avatar Nov 11 '19 00:11 nikita-volkov

Does it work if you use the postgresDialect in the parse flags? The default dialect is ANSI which doesn't support this syntax for casts. The dialect support is a bit flakey at the moment.

JakeWheat avatar Nov 16 '19 11:11 JakeWheat

Already moved on to another solution. Sorry

nikita-volkov avatar Nov 17 '19 08:11 nikita-volkov