Re: using queries as default value?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Don Patou <pknoob(at)noos(dot)fr>, pgsql-novice(at)postgresql(dot)org
Subject: Re: using queries as default value?
Date: 2003-05-30 22:24:21
Message-ID: 200305301524.21168.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Don,

> 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?

Add a Trigger to the table. See Triggers in the online docs, and also under
the PL/pgSQL docs (under "Procedural Languages").

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2003-05-30 22:31:32 Re: using queries as default value?
Previous Message Don Patou 2003-05-30 22:04:22 using queries as default value?