select CURRENT_DATE + i
from generate_series(date '2012-06-29'- CURRENT_DATE,
date '2012-07-03' - CURRENT_DATE ) i
or even shorter:
select i::date from generate_series('2012-06-29',
'2012-07-03', '1 day'::interval) i
Related Contents:
- How do you do date math that ignores the year?
- Are PostgreSQL column names case-sensitive?
- How to return only the Date from a SQL Server DateTime datatype
- PostgreSQL unnest() with element number
- How to check if a table exists in a given schema
- How to use RETURNING with ON CONFLICT in PostgreSQL?
- Does PostgreSQL support “accent insensitive” collations?
- Comparing Dates in Oracle SQL
- How to list table foreign keys
- PostgreSQL: using a calculated column in the same query
- Optimise PostgreSQL for fast testing
- Fast way to discover the row count of a table in PostgreSQL
- How to use ANY instead of IN in a WHERE clause?
- Concatenate multiple result rows of one column into one, group by another column [duplicate]
- Return multiple columns of the same row as JSON array of objects
- Normalize array subscripts so they start with 1
- sql ORDER BY multiple values in specific order?
- ERROR: there is no unique constraint matching given keys for referenced table “bar”
- Delete duplicate rows (don’t delete all duplicate)
- Safely rename tables using serial primary key columns
- How do I determine the last day of the previous month using PostgreSQL?
- Is there something like a zip() function in PostgreSQL that combines two arrays?
- Change PostgreSQL columns used in views
- subquery in FROM must have an alias
- PostgreSQL multi INSERT…RETURNING with multiple columns
- updating table rows in postgres using subquery
- Why can’t I use column aliases in the next SELECT expression?
- Preventing adjacent/overlapping entries with EXCLUDE in PostgreSQL
- Finding similar strings with PostgreSQL quickly
- Use email address as primary key?
- PostgreSQL: encoding problems on Windows when using psql command line utility
- Polymorphism in SQL database tables?
- Difference between datetime and timestamp in sqlserver? [duplicate]
- SQL column reference “id” is ambiguous
- How to use multiple CTEs in a single SQL query?
- Postgres analogue to CROSS APPLY in SQL Server
- How do I ALTER a PostgreSQL table and make a column unique?
- Oracle equivalent of Postgres’ DISTINCT ON?
- Casting NULL type when updating multiple rows
- Bulk/batch update/upsert in PostgreSQL
- Why do NULL values come first when ordering DESC in a PostgreSQL query?
- Export specific rows from a PostgreSQL table as INSERT SQL script
- SQL SERVER: Get total days between two dates
- How to use an ALIAS in a PostgreSQL ORDER BY clause?
- postgresql generate sequence with no gap
- I keep getting the error “relation [TABLE] does not exist”
- Error: Column does not exist
- Get execution time of PostgreSQL query
- Why is PostgreSQL not using my indexes on a small table?
- Aggregating (x,y) coordinate point clouds in PostgreSQL