{"action":"created","issue":{"url":"https://api.github.com/repos/go-pg/pg/issues/899","repository_url":"https://api.github.com/repos/go-pg/pg","labels_url":"https://api.github.com/repos/go-pg/pg/issues/899/labels{/name}","comments_url":"https://api.github.com/repos/go-pg/pg/issues/899/comments","events_url":"https://api.github.com/repos/go-pg/pg/issues/899/events","html_url":"https://github.com/go-pg/pg/issues/899","id":339538582,"node_id":"MDU6SXNzdWUzMzk1Mzg1ODI=","number":899,"title":"Does go-pg support Postgresql 10.4 ?","user":{"login":"ivansalacceo","id":15266932,"node_id":"MDQ6VXNlcjE1MjY2OTMy","avatar_url":"https://avatars0.githubusercontent.com/u/15266932?v=4","gravatar_id":"","url":"https://api.github.com/users/ivansalacceo","html_url":"https://github.com/ivansalacceo","followers_url":"https://api.github.com/users/ivansalacceo/followers","following_url":"https://api.github.com/users/ivansalacceo/following{/other_user}","gists_url":"https://api.github.com/users/ivansalacceo/gists{/gist_id}","starred_url":"https://api.github.com/users/ivansalacceo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivansalacceo/subscriptions","organizations_url":"https://api.github.com/users/ivansalacceo/orgs","repos_url":"https://api.github.com/users/ivansalacceo/repos","events_url":"https://api.github.com/users/ivansalacceo/events{/privacy}","received_events_url":"https://api.github.com/users/ivansalacceo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-09T17:22:49Z","updated_at":"2018-07-11T16:55:28Z","closed_at":null,"author_association":"NONE","body":"I have a go-app which use elephantsql as database service (https://www.elephantsql.com/). I have no problem with that. However, when I change the database to local postgresql, the app gives different result which is not expected. Moreover, when I try to query manually with pgAdmin on local computer it gives expected result. Therefore, temporarily I assume that something is wrong with go-pg.\r\nElephantsql postgresql version:\r\n`PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit`\r\n\r\nLocal postgresql version (run on Windows OS):\r\n`PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit`\r\n\r\nHere is the app code:\r\n```\r\nfunc GetCostRange(min_date string, max_date string) (*[]int32, error) {\r\n\tvar costs = &[]int32{}\r\n\t_, err := db.Query(costs, `\r\n        SELECT coalesce(res.sum, 0)\r\n        FROM generate_series\r\n            (\r\n                ?::TIMESTAMPTZ AT TIME ZONE 'Asia/Jakarta',\r\n                ?::TIMESTAMPTZ AT TIME ZONE 'Asia/Jakarta',\r\n                INTERVAL '1 month'\r\n            ) AS gen_month LEFT JOIN\r\n            (\r\n                SELECT date_trunc('month', transaction_date AT TIME ZONE 'Asia/Jakarta') AS mon_year, SUM(amount)\r\n                FROM expenses\r\n                GROUP BY mon_year\r\n            ) AS res\r\n            ON gen_month = res.mon_year;\r\n    `, min_date, max_date)\r\n\tlog.Printf(\"%s\", costs)\r\n\r\n\treturn costs, err\r\n}\r\n```  \r\nUsing the elephantsql yield the result, for example:\r\n[0,0,100000,20000,300000]\r\n\r\nManually query on local computer with pgAdmin yield the result, for example:\r\n[0,0,100000,20000,300000]\r\n\r\nResult of app (on local computer) with go-pg query yield the result, for example:\r\n[0,0,0,0,0]\r\nwhere it should be the same with manually query on local computer, which is\r\n[0,0,100000,20000,300000]\r\n\r\nAny help would be appreciated."},"comment":{"url":"https://api.github.com/repos/go-pg/pg/issues/comments/404239540","html_url":"https://github.com/go-pg/pg/issues/899#issuecomment-404239540","issue_url":"https://api.github.com/repos/go-pg/pg/issues/899","id":404239540,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDIzOTU0MA==","user":{"login":"ivansalacceo","id":15266932,"node_id":"MDQ6VXNlcjE1MjY2OTMy","avatar_url":"https://avatars0.githubusercontent.com/u/15266932?v=4","gravatar_id":"","url":"https://api.github.com/users/ivansalacceo","html_url":"https://github.com/ivansalacceo","followers_url":"https://api.github.com/users/ivansalacceo/followers","following_url":"https://api.github.com/users/ivansalacceo/following{/other_user}","gists_url":"https://api.github.com/users/ivansalacceo/gists{/gist_id}","starred_url":"https://api.github.com/users/ivansalacceo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivansalacceo/subscriptions","organizations_url":"https://api.github.com/users/ivansalacceo/orgs","repos_url":"https://api.github.com/users/ivansalacceo/repos","events_url":"https://api.github.com/users/ivansalacceo/events{/privacy}","received_events_url":"https://api.github.com/users/ivansalacceo/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T16:55:28Z","updated_at":"2018-07-11T16:55:28Z","author_association":"NONE","body":"I just have a thought that when the query result type is bigint and the golang variable used to store the result is int32, it will give 0 result. I haven't checked it though, since it's on my client computer. I will post the result later here. Thanks for the reply @vmihailenco "}}
{"actor":{"display_login":"ivansalacceo"}}