User loginRecent blog posts
Homeland Security Advisory System
Popular contentToday's: |
Populating a PostgreSQL Calendar TableSubmitted by geekwisdom on Sun, 2007-10-28 15:01.
I'm using PostgreSQL for my data warehouse. I needed a calendar table for doing joins and a quick way to populate it. So I created my calendar table with:
CREATE TABLE "CALENDAR" (Then I populated it with the following SQL: INSERT INTO "CALENDAR" ("YYYYMMDD") select to_date('20000101', 'YYYYMMDD') + s.a as dates from generate_series(0,36524,1) as s(a);This quickly puts records into the CALENDAR table for every day starting with 1/1/2000 and ending with 12/31/2099. ( categories: Programming/Architecture )
|
Mozilla Project
Google SearchesGeek(Wisdom).com is not affiliated with google. We just like their search engine.
SyndicationFront Page Programming/Architecture Security/Privacy Systems Administration Old SiteLooking for the old, old site? 2008/07/08 22:15:30
|