-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Environment
- PostgreSQL version: v14.12
- PostgREST version: v12.2.3
- Operating system: MacOS
Description of issue
Hi there, I'd like to report some buggy 'content-range' value in the response header with aggregation function.
- Minimal SQL definition
CREATE TABLE employees (
id SERIAL PRIMARY KEY,
organization_id INTEGER,
first_name VARCHAR,
last_name VARCHAR,
gender VARCHAR,
status VARCHAR
);
- How I make a request to Postgrest:
http:<postgrest_url>/employees?limit=100&offset=0&and=(or(status.like.active))&select=count(),gender
- The behaviour I expect:
In the response header, "content-range" value should be '0-2/3'. There are only 3 gender values in DB: male, female, undisclosed. - The actual behaviour:
In the response header, "content-range" value is '0-2/147'.
I suspect the total number of record "147" is from the total number of records without aggregation.
When I make a request without aggregation;http:<postgrest_url>/employees?limit=100&offset=0&and=(or(status.like.active))
I have '0-99/147' as "content-range" value in the response header.
Thank you in advance!