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

ParseInt error when scanning table #22

Closed
honza opened this issue Jan 5, 2016 · 10 comments
Closed

ParseInt error when scanning table #22

honza opened this issue Jan 5, 2016 · 10 comments
Labels

Comments

@honza
Copy link

honza commented Jan 5, 2016

2016/01/05 11:42:24 Starting Pome 0.1.0
2016/01/05 11:42:24 Application will be available at http://127.0.0.1:2345
2016/01/05 11:42:24 sql: Scan error on column index 3: converting string "1.1198464e+07" to a int: strconv.ParseInt: parsing "1.1198464e+07": invalid syntax

Using version 804786e

@rach rach added the bug label Jan 5, 2016
@rach rach mentioned this issue Jan 5, 2016
@ober
Copy link

ober commented Jan 5, 2016

Hit by it too.

@rach
Copy link
Owner

rach commented Jan 6, 2016

I will try to get that fixed asap. I suspect that some of the sql query needs some adjustment as the Go Sql lib cannot handle the conversion.

@rach
Copy link
Owner

rach commented Jan 6, 2016

It seems like the problem come from SUM used for the database size. SUM of bigint return a numeric type. I don't think that we will support db above int64 size

 select pg_size_pretty(9223372036854775807);
 pg_size_pretty
----------------
 8388608 TB
(1 row)

I now cat the result to bigint so it should solve the problem.
I wasn't not able to reproduce the bug even when replacing query with SELECT 1.1198464e+07 , 1.1198464e+07::numeric so it will be amazing if you could test b051abf

thanks

@honza
Copy link
Author

honza commented Jan 6, 2016

Unfortunately, the problem persists:

2016/01/06 10:13:54 Starting Pome 0.1.1
2016/01/06 10:13:54 Application will be available at http://127.0.0.1:2345
2016/01/06 10:13:54 sql: Scan error on column index 3: converting string "1.1198464e+07" to a int: strconv.ParseInt: parsing "1.1198464e+07": invalid syntax

The database is pretty small, like 300MB.

I'm using Postgresql 9.4.5 on OSX.

@rach
Copy link
Owner

rach commented Jan 6, 2016

I will publish a verbose mode later tonight, I realize that I added the cast on the wrong db query.
Base on the index 3 then it means that the problem appear on TableBloat.
Thanks for trying and your patience, I'll try get that fixed asap.

@internetuser2008
Copy link

Getting same error on Mac OSX Postgres 9.4.4

2016/01/06 13:52:21 Starting Pome 0.1.1
2016/01/06 13:52:21 Application will be available at http://127.0.0.1:2345
2016/01/06 13:52:21 sql: Scan error on column index 3: converting string "2.031616e+06" to a int: strconv.ParseInt: parsing "2.031616e+06": invalid syntax

@jmealo
Copy link

jmealo commented Jan 6, 2016

Same issue using the latest Go and Pome on Ubuntu 14.04 (64-bit).

@ThisIsMissEm
Copy link

I'm getting similar, with 2016/01/07 03:19:55 sql: Scan error on column index 3: converting string "4.145152e+06" to a int: strconv.ParseInt: parsing "4.145152e+06": invalid syntax

rach added a commit that referenced this issue Jan 7, 2016
@rach rach closed this as completed in c866672 Jan 7, 2016
@honza
Copy link
Author

honza commented Jan 7, 2016

The fix works for me, thanks. ✨

@rach
Copy link
Owner

rach commented Jan 8, 2016

Great. Thanks for testing it. I should have been more careful about the types of some of the SQL query.

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

No branches or pull requests

6 participants