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

No rows returned if a row contains unicode character #88

Closed
frodeaa opened this issue Jan 8, 2015 · 4 comments
Closed

No rows returned if a row contains unicode character #88

frodeaa opened this issue Jan 8, 2015 · 4 comments

Comments

@frodeaa
Copy link

frodeaa commented Jan 8, 2015

SQL queries returned empty row, found out that it was caused by unicode character.

create table my_table (val text);
insert into my_table (val) values ('a'), ('b'), ('unicode \u2013 is – here');
my-db> select * from my_table limit 2
+-------+
| val   |
|-------|
| a     |
| b     |
+-------+
SELECT 2
my-db> select * from my_table limit 3

my-db>

We get the expected rows if we use the row_to_json function

my-db> select row_to_json(row(val)) from my_table limit 3
+--------------------------------------------+
| row_to_json                                |
|--------------------------------------------|
| {u'f1': u'a'}                              |
| {u'f1': u'b'}                              |
| {u'f1': u'unicode \\u2013 is \u2013 here'} |
+--------------------------------------------+
SELECT 3
my-db>
@macobo
Copy link
Contributor

macobo commented Jan 8, 2015

This should be fixed in the latest version and I am not able to reproduce it either - what version of pgcli do you have installed?

@frodeaa
Copy link
Author

frodeaa commented Jan 8, 2015

$ pip list | grep pgcli
pgcli (0.10.0)

and I can confirm that it works correctly in 0.10.3, will close the issue.
The bug seems to be fixed in 0.10.1 by 4aaa117

@frodeaa frodeaa closed this as completed Jan 8, 2015
@amjith
Copy link
Member

amjith commented Jan 8, 2015

@frodeaa Can you try upgrading pgcli?

pip install -U pgcli.

@frodeaa
Copy link
Author

frodeaa commented Jan 8, 2015

yes, upgrading fixes the problem @amjith

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

3 participants