-
Notifications
You must be signed in to change notification settings - Fork 90
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
postgresql_query is not able use variable list as postgreSQL Json #328
Comments
thanks for the report @sivanagireddyb . I haven't looked at the code, but does using single-quotes instead of double-quotes fail w/ the same error? |
@hunleyd Yes, Double quotes are also giving same error. I had to use |
ok thanks for the update @sivanagireddyb . we'll look into the issue and see if we can code up a fix. |
@sivanagireddyb hello, thanks for reporting the issue. I'm not a Postgres JSON user.
thanks |
@sivanagireddyb could you please take a look? ^ |
Even though postgress type is Json it accepts list, Which worked for me when tested with hard-coded value instead of variable. |
@sivanagireddyb if you pass the string |
I haven't tested it but the the format I was expecting is in list |
Using ascii filter along with json worked for me.
|
Summary
I am not able to use the variable list as postgreSQL Json argument in the psql query
PostgreSQL accept Json in format ["[email protected]","[email protected]"]
On manipulating variable list ["[email protected]", "[email protected]"]
Error:
Invalid input syntax for type json\n LINE 1:... Token \"'\" is invalid
Issue Type
Bug Report
Component Name
postgresql_query
Ansible Version
Configuration
# if using a version older than ansible-core 2.12 you should omit the '-t all'
OS / Environment
CENTOS
Steps to Reproduce
Expected Results
List variable should be inserted
Actual Results
Invalid input syntax for type json\n LINE 1:... Token \"'\" is invalid
The text was updated successfully, but these errors were encountered: