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

Missing parantheses causes problems with HSTOREs containing newlines #117

Open
saurabhnanda opened this issue Jul 26, 2024 · 3 comments
Open
Assignees

Comments

@saurabhnanda
Copy link

In PostgreSQL, if an HSTORE column contains a newline, Jailer will export the value as...

'"key"=>"value' || chr(10) || 'with newlines"' :: hstore

... which results in the following error when executing in psql:

psql=# select '"key"=>"value' || chr(10) || 'with newlines"' :: hstore;
ERROR:  Syntax error near "n" at position 5
LINE 1: select '"key"=>"value' || chr(10) || 'with newlines"' :: hst...

However, if the HSTORE value were to be exported with parantheses, as shown below...

('"key"=>"value' || chr(10) || 'with newlines"') :: hstore

...I believe it would work:

psql=# select ('"key"=>"value' || chr(10) || 'with newlines"') :: hstore;
     hstore     
----------------
 "key"=>"value +
 with newlines"
(1 row)
@saurabhnanda saurabhnanda changed the title Missnig parantheses causes problems with HSTOREs containing newlines Missing parantheses causes problems with HSTOREs containing newlines Jul 26, 2024
@Wisser Wisser self-assigned this Jul 26, 2024
@Wisser
Copy link
Owner

Wisser commented Jul 31, 2024

Thank you for the error report!
This has been fixed in release 16.4.

@saurabhnanda
Copy link
Author

@Wisser thank you for the quick response. Actually, I discovered this to be a bug for TEXT columns as well. Does 16.4 fix that as well?

@Wisser
Copy link
Owner

Wisser commented Jul 31, 2024

Yes, it works for all literals. Let me know if you find any other issues.

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

2 participants