Skip to content

Postgres does not support named timezones #4307

@amajedi

Description

@amajedi

I'm using a raw sequelize query in node to execute a postgresql function which returns a query. The problem I'm having is that the result set obtained from running the query in pgAdmin does not match the result set returned in node when using the .query() method, even though the query in pgAdmin and the query in node are both exactly the same.

here's the query I'm performing:

SELECT * FROM foo('2015-07-01','2015-07-31');
This query returns 91875 rows in pgAdmin, however, in node using sequelize, running the following only returns 87500 rows:

models.sequelize.query("SELECT * FROM foo('2015-07-01','2015-07-31');")
.spread(function (results, metadata) {
console.log(results.length);
});
output: 87500

The rows which are excluded correspond to the last date 2015-07-31.

I found that I can obtain all the rows in node by increasing the 2nd date parameter to go beyond the end date. For example, if my goal is to get results which include 2015-07-31, setting the end date to be 2015-08-03 works. Although, this is masking the problem and not ideal.

I thought there must be something wrong with the WHERE clause in my stored procedure function. However, if that was the case, why do I get back the desired number of rows when I run the query though pgAdmin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).good first issueFor issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions