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

pq: integer out of range #12

Closed
delfrrr opened this issue Apr 28, 2021 · 2 comments
Closed

pq: integer out of range #12

delfrrr opened this issue Apr 28, 2021 · 2 comments

Comments

@delfrrr
Copy link
Contributor

delfrrr commented Apr 28, 2021

No description provided.

@delfrrr
Copy link
Contributor Author

delfrrr commented Apr 28, 2021

This query was causing the error

select
			id,
			query_text,
			job_status,
			case when job_result_id is null then '' else cast(job_result_id as VARCHAR) end as job_result_id,
			case when job_error is null then '' else job_error end as job_error,
			case
				when job_started is null
				then 0
				else CAST((extract('epoch' from CURRENT_TIMESTAMP)  - extract('epoch' from job_started))*1000 as INTEGER)
			end as job_duration,
			total_rows,
			bytes_processed,
			result_size
		from queries where report_id='5b8ace27-8f97-41d7-93c6-cf8369048dca'

this particular segment extract('epoch' from job_started))*1000 as INTEGER)

@delfrrr
Copy link
Contributor Author

delfrrr commented Apr 28, 2021

Solution was to use BIGINT;

Postgres max INTEGER        2147483648
JavaScript max safe integer 9007199254740991
Postgres BIGINT             9223372036854775808

Interesting that protobuf-js still parse BIGINT as Number

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

1 participant