Re: using queries as default value?

From: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
To: Don Patou <pknoob(at)noos(dot)fr>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: using queries as default value?
Date: 2003-05-30 22:31:32
Message-ID: 1054333892.654.0.camel@billy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Am Sam, 2003-05-31 um 00.04 schrieb Don Patou:
> is it possible to have a query as a column default value. I have a statistic
> table and I would like one of its column to do like "select count(colx) from
> anothertable".
> What's the best way to do this?

Maybe what you want is a VIEW.
But that would always do the query _at runtime_, not while inserting.

HTH
--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-05-30 23:06:54 Re: using queries as default value?
Previous Message Josh Berkus 2003-05-30 22:24:21 Re: using queries as default value?