Can be done without conversion to/from int (but to/from timestamp instead)
SELECT date_trunc('day', dd):: date
FROM generate_series
( '2007-02-01'::timestamp
, '2008-04-01'::timestamp
, '1 day'::interval) dd
;
More Related Contents:
- Generate series of dates – using date type as input
- How to exit from PostgreSQL command line utility: psql
- I forgot the password I entered during postgres installation
- Test for null in function with varying parameters
- Postgres query optimization (forcing an index scan)
- Dynamically generate columns for crosstab in PostgreSQL
- I forgot the password I entered during PostgreSQL installation
- PostgreSQL ERROR: canceling statement due to conflict with recovery
- Change type of varchar field to integer: “cannot be cast automatically to type integer”
- Postgresql insert trigger to set value
- How to add column if not exists on PostgreSQL?
- How to perform a select query in a DO block?
- now() default values are all showing same timestamp
- Join a count query on generate_series() and retrieve Null values as ‘0’
- Convert escaped Unicode character back to actual character in PostgreSQL
- Insert, on duplicate update in PostgreSQL?
- How does the search_path influence identifier resolution and the “current schema”
- PostgreSQL error: Fatal: role “username” does not exist
- See and clear Postgres caches/buffers?
- Store query result in a variable using in PL/pgSQL
- How to convert a postgres database to sqlite
- How can I change a PostgreSQL user password?
- Function to loop through and select data from multiple tables
- SQL query column does not exist error
- Orbeon Forms Postgres DB connection
- PostgreSQL disable more output
- PostgreSQL array_agg order
- Postgres table column name restrictions?
- PostgreSQL jsonb, `?` and JDBC
- Syntax error at end of input in PostgreSQL