Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malformed array literal #571

Closed
Qinka opened this issue Jun 4, 2016 · 10 comments
Closed

malformed array literal #571

Qinka opened this issue Jun 4, 2016 · 10 comments

Comments

@Qinka
Copy link

Qinka commented Jun 4, 2016

I inserted a row of data, and got the followed error.

SqlError {sqlState = \"22P02\", sqlExecStatus = FatalError, sqlErrorMsg = \"malformed array literal: \\\"[1,1,1]\\\"\", sqlErrorDetail = \"Missing \\\"]\\\" after array dimensions.\", sqlErrorHint = \"\"}

And my Postgres has such output:

ERROR:  malformed array literal: "[1,1,1]" at character 200
DETAIL:  Missing "]" after array dimensions.
STATEMENT:  INSERT INTO "table_task_info"("key_tid","key_ew","key_ns","key_r","key_wei","key_size","key_note","key_cost","key_des") VALUES('T2016-06-048c330b133d149fd972ad0bd700e5664bb71e1cf1',1.0,1.0,100.0,1.0,'[1,1,1]',null,100,null)
@Qinka
Copy link
Author

Qinka commented Jun 4, 2016

I don't know whether I used PostgreSQL array and persistent in a wrong way, but to seemed that some functions is not suitable.

I don't know why array is transformed to JSON's array but not to SQL's array. However, it do.

@gregwebs
Copy link
Member

gregwebs commented Jun 4, 2016

Are you using persistent for migrations?

@Qinka
Copy link
Author

Qinka commented Jun 4, 2016

I just use insert function.

@Qinka
Copy link
Author

Qinka commented Jun 5, 2016

I think listToJSON (at Database/Persist/PostgreSQL.hs:line:305 ) should be changed to PG.PGArray.

And if you think it's necessary, I will fork and send a new pull request.

@gregwebs
Copy link
Member

gregwebs commented Jun 5, 2016

PR would be great.

@Qinka
Copy link
Author

Qinka commented Jun 5, 2016

Sorry, I'm not good at English, and what does PR stand for?

@psibi
Copy link
Member

psibi commented Jun 5, 2016

Pull Request. :)

@Qinka
Copy link
Author

Qinka commented Jun 5, 2016

😂

@MaxGabriel
Copy link
Member

For the longest time I thought "LGTM" meant "Let's get this merged"

@parsonsmatt
Copy link
Collaborator

persistent-postgresql-2.10.0 supports arrays with the new PersistArray :: [PersistValue] -> PersistValue constructor. #884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants