Re: Auto Adjust Age

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto Adjust Age
Date: 2011-04-06 15:24:29
Message-ID: 20110406152429.GB2277@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 06, 2011 at 11:15:31AM -0400, Jerry Sievers wrote:

> I'd suggest not storing age but instead wrapping with a view that calls
> date_trunc('year', now() - dob).

Or put that in the query:

SELECT
...,
date_trunc('year', now() - dob) as age
FROM
users
;

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Mennens 2011-04-06 15:30:43 Re: Auto Adjust Age
Previous Message JC de Villa 2011-04-06 15:24:08 Re: Auto Adjust Age