I need to fill up a sparse table in an view - Mailing list pgsql-sql

From Andreas
Subject I need to fill up a sparse table in an view
Date
Msg-id 5132536A.50508@gmx.net
Whole thread Raw
Responses Re: I need to fill up a sparse table in an view
List pgsql-sql
Hi,

I need to fill up a sparse table in an view.
The table holds some numbers relating months and objects.
The month is an integer in the format YYYYMM.

To make it more convenient to manage this table I decidet to let a value 
be good till the next entry.
E.g. if there is an entry in january and march, the january entry is 
good in february, too.


So the table looks like.
my_numbers ( object_id int, month int, some_nr int )

( 17, 201301, 123 ),
( 42, 201301, 456 ),
( 42, 201303, 789 ),

Now I need a view that fills the gaps up till the current month.


( 17, 201301, 123 ),
( 17, 201302, 123 ),      <-- filled gap
( 17, 201303, 123 ),      <-- filled gap
( 42, 201301, 456 ),
( 42, 201302, 456 ),      <-- filled gap
( 42, 201303, 789 ),


Is this possible?



pgsql-sql by date:

Previous
From: Wayne Cuddy
Date:
Subject: Re: Need help revoking access WHERE state = 'deleted'
Next
From: Victor Yegorov
Date:
Subject: Re: I need to fill up a sparse table in an view