Re: [SQL] date range to set of dates expansion

2012-01-20 Thread Gary Stainburn
On Thursday 19 January 2012 16:50:53 Steve Crawford wrote: > I'm sure most here would recommend moving to 9.1 rather than 8.4. Better > performance, cooler replication functionality, more advanced in-place > upgrade capabilities for future upgrades, a couple years longer before > end-of-life, advan

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
On 01/19/2012 09:17 AM, Samuel Gendler wrote: On Thu, Jan 19, 2012 at 8:20 AM, Adrian Klaver mailto:adrian.kla...@gmail.com>> wrote: On Thursday, January 19, 2012 7:59:27 am Gary Stainburn wrote: > The following code works in 8.4 but not 8.3. > Anyone know why, or what I need to

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Samuel Gendler
On Thu, Jan 19, 2012 at 8:20 AM, Adrian Klaver wrote: > On Thursday, January 19, 2012 7:59:27 am Gary Stainburn wrote: > > The following code works in 8.4 but not 8.3. > > Anyone know why, or what I need to do to change it? > > > > SELECT aid, asid, > >date_range (asdate, afdate)::date AS

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Steve Crawford
On 01/19/2012 07:16 AM, Gary Stainburn wrote: On Thursday 19 January 2012 15:11:46 Gary Stainburn wrote: I'll be upgrading my live server as soon as possible, but in the meantime can anyone suggest a way I can do the same thing using Postgresql 8.1 until I can evaluate 8.4 on my live systems? I

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
On Thursday, January 19, 2012 7:59:27 am Gary Stainburn wrote: > The following code works in 8.4 but not 8.3. > Anyone know why, or what I need to do to change it? > > SELECT aid, asid, >date_range (asdate, afdate)::date AS asdate, >acomments > FROM availability > > In 8.4 it retu

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Gary Stainburn
The following code works in 8.4 but not 8.3. Anyone know why, or what I need to do to change it? SELECT aid, asid, date_range (asdate, afdate)::date AS asdate, acomments FROM availability In 8.4 it returns the expanded dataset as required. In 8.3 I get: ERROR: set-valued function

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Gary Stainburn
On Thursday 19 January 2012 15:11:46 Gary Stainburn wrote: > I'll be upgrading my live server as soon as possible, but in the meantime > can anyone suggest a way I can do the same thing using Postgresql 8.1 > until I can evaluate 8.4 on my live systems? Sorry, I meant 8.3 as my current version

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Gary Stainburn
On Thursday 19 January 2012 08:32:27 hari.fu...@gmail.com wrote: > > Why don't you just use the built-in PostgreSQL function for that? > > SELECT aid, asid, >generate_series (asdate, afdate, INTERVAL '1 day')::date AS asdate, >acomments > FROM tbl 1) because I didn't know about it

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread hari . fuchs
Gary Stainburn writes: > Hi, > > How can I expand a date range in a table to a set of date records? > > I have a table of availabilities thus: > > Column |Type | Modifiers > ---+-+-

[SQL] date range to set of dates expansion

2012-01-18 Thread Gary Stainburn
Hi, How can I expand a date range in a table to a set of date records? I have a table of availabilities thus: Column |Type | Modifiers ---+-+ aid