Closed rashadg1030 closed 5 years ago
errSQLType = "text"
indicates that either libpq reports column to have text type, or pgs misinterprets libpq somehow.
Have you tried adding type annotation to array in sql code? Maybe postgres can't inference type of empty array and thinks it's text.
@rashadg1030 @sopvop note that this is not the issue tracker of postgresql-simple
anymore. I'd recommend to avoid commenting it.
I cannot close issues in this tracker, e.g.
See https://github.com/phadej/postgresql-simple/issues/21#issuecomment-508013439
errSQLType = "text"
indicates that either libpq reports column to have text type, or pgs misinterprets libpq somehow. Have you tried adding type annotation to array in sql code? Maybe postgres can't inference type of empty array and thinks it's text.
@sopvop This is exactly what I needed to do. Thank you!
I'm using
postgresql-simple
on a project and I'm wondering if the typePGArray
satisfies roundtrip property tests and if not what I can do to fix that. In the project I have anIssue
type which is a record:SqlArray
is a wrapper around thePGArray
type defined as:Our SQL schema for the issues table looks like this:
I'm using
hedgehog
to test that queries to the database satisfy the roundtrip property. The test looks like this:I want the
parsedIssue
to be equal to thegeneratedIssue
and it seems to work except for when thePGArray
is empty. The test only fails when thePGArray
is empty. It fails with this error:There is an
Incompatible
error and I'm trying to figure out if this because of the wayPGArray
is implemented or something else. I will continue to do testing and update this issue. Thank you for reading.