virtual (COMPUTED BY) columns?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: ML PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: virtual (COMPUTED BY) columns?
Date: 2007-01-28 16:25:33
Message-ID: 45BCCE7D.2060104@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

These fields do not use any disk space, as the data in them is
derived on the fly.

For example:
CREATE TABLE T_EXAMPLE (
SOME_DATE DATE,
JDATE COMPUTED BY EXTRACT(JULIAN FROM SOME_DATE)
);

A work-around is to create a function, and reference it in every
query, but storing them in the table definition is the "tidy",
low-maintenance way to do it.

Thanks
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFvM59S9HxQb37XmcRAtFvAKC51YTKLLy+v+0TXMhGIyX2PmO2EQCfW8gy
yIn2EBd5gR82/Hf+j5CB+rQ=
=4Csd
-----END PGP SIGNATURE-----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Phil Endecott 2007-01-28 16:31:06 "explain analyse" much slower than actual query
Previous Message Chad Wagner 2007-01-28 16:02:16 Re: counting query