14 Dec 2006 02:45:12 -0800, SunWuKung <[EMAIL PROTECTED]>:
> CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT
>(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm
> ,[default]),COALESCE(new.info,[default]));
what would [default] insert here?
A constant, a
On Thu, 2006-12-14 at 02:45 -0800, SunWuKung wrote:
> > CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT
> >(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm
> > ,[default]),COALESCE(new.info,[default]));
>
> what would [default] insert here?
> the default of the v
> CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT
>(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm
> ,[default]),COALESCE(new.info,[default]));
what would [default] insert here?
the default of the view or the default of the underlying table?
B.
-
On Thu, 2006-12-14 at 08:01 -0200, William Leite Araújo wrote:
>
> On 12/13/06, Rafal Pietrak <[EMAIL PROTECTED]> wrote:
> CREATE RULE new_entry_notm AS ON INSERT to logview WHERE
> new.tm IS NULL
> DO INSTEAD INSERT (id,info) VALUES (new.id,new.info);
> CREATE RULE
On 12/13/06, Rafal Pietrak <[EMAIL PROTECTED]> wrote:
Hi,
May be someone could help me with this:
For some time now, I exercise the use of VIEWs to expose just the
features of TABLES a particular user is supposed to see/have.
I can see that with a VIEW, I can do prity mutch everything I can d
Tom Lane wrote:
> Rafal Pietrak <[EMAIL PROTECTED]> writes:
>> I can see that with a VIEW, I can do prity mutch everything I can do
>> with a TABLE, so a VIEW mimics a TABLE quite well but one feature: a
>> default value for a row on INSERT.
>
> You can add a default to a view's column, either
On Wed, 2006-12-13 at 11:08 -0500, Tom Lane wrote:
>
> You can add a default to a view's column, either the same as the
> underlying table's default, or different if you want.
>
> ALTER TABLE view ALTER COLUMN col SET DEFAULT expr
G! The obvious solutions are most difficult to spot.
Thenx!
--
Rafal Pietrak <[EMAIL PROTECTED]> writes:
> I can see that with a VIEW, I can do prity mutch everything I can do
> with a TABLE, so a VIEW mimics a TABLE quite well but one feature: a
> default value for a row on INSERT.
You can add a default to a view's column, either the same as the
underlyi
Hi,
May be someone could help me with this:
For some time now, I exercise the use of VIEWs to expose just the
features of TABLES a particular user is supposed to see/have.
I can see that with a VIEW, I can do prity mutch everything I can do
with a TABLE, so a VIEW mimics a TABLE quite well b