Re: [GENERAL] question about age()

2013-08-30 Thread Andreas Kretschmer
Tom Lane wrote: > Andreas Kretschmer writes: > > '3 years' != '2 years 11 mons 30 days', but i got 0 rows, why? > > Well, actually: > > regression=# select '3 years'::interval = '2 years 11 mons 30 days'::interval; > ?column? > -- > t > (1 row) > > IIRC, interval comparison operato

Re: [GENERAL] question about age()

2013-08-29 Thread Tom Lane
Andreas Kretschmer writes: > '3 years' != '2 years 11 mons 30 days', but i got 0 rows, why? Well, actually: regression=# select '3 years'::interval = '2 years 11 mons 30 days'::interval; ?column? -- t (1 row) IIRC, interval comparison operators normalize the two values assuming that

Re: [GENERAL] question about age()

2013-08-29 Thread Michael Nolan
On 8/29/13, Michael Nolan wrote: > On 8/29/13, Andreas Kretschmer wrote: > >> I'm using 9.2.4. > > > What is the content of the field 'birthday''? My guess is there's a > null value for the field, in which case you are comparing two nulls. Oops, missed seeing the first half of the post with the

Re: [GENERAL] question about age()

2013-08-29 Thread Michael Nolan
On 8/29/13, Andreas Kretschmer wrote: > is there a bug in age()? > > test=*# select *, age(birthday), age (current_date-1, birthday) from > birthday ; > id | birthday | age | age > ++-+- > 1 | 2010-08-29 | 3 years | 2 years 11 mons

Re: [GENERAL] question about age()

2013-08-29 Thread Rob Sargent
On 08/29/2013 01:11 PM, Andreas Kretschmer wrote: is there a bug in age()? test=*# select *, age(birthday), age (current_date-1, birthday) from birthday ; id | birthday | age | age ++-+- 1 | 2010-08-29 | 3 years | 2 years 11 mo

Re: [GENERAL] question about age()

2013-08-29 Thread Karsten Hilbert
On Thu, Aug 29, 2013 at 09:11:07PM +0200, Andreas Kretschmer wrote: > test=*# select * from birthday where age(birthday) != age (current_date-1, > birthday); > id | birthday > +-- > (0 rows) > > '3 years' != '2 years 11 mons 30 days', but i got 0 rows, why? What does selec

[GENERAL] question about age()

2013-08-29 Thread Andreas Kretschmer
is there a bug in age()? test=*# select *, age(birthday), age (current_date-1, birthday) from birthday ; id | birthday | age | age ++-+- 1 | 2010-08-29 | 3 years | 2 years 11 mons 30 days (1 row) Time: 0,322 ms test=*# select * fr