Re: A VIEW mimicing a TABLE

Поиск
Список
Период
Сортировка
От Rafal Pietrak
Тема Re: A VIEW mimicing a TABLE
Дата
Msg-id 1166097143.27564.114.camel@zorro.isa-geek.com
обсуждение исходный текст
Ответ на Re: A VIEW mimicing a TABLE  ("SunWuKung" <Balazs.Klein@t-online.hu>)
Список pgsql-general
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 view or the default of the underlying table?

I admit, I haven't tested that myself yet.

But as I understand 'the theory', it would be the default of a VIEW.

This is because we don't have any means to access the [default] of an
underlaying table (nothing like 'foreign-default-reference' :), so we
define a [default] for a VIEW as an entirely separate entity.

This might be a problem for sequences, but in that case, we may put
*the*same* sequence for a VIEW [default] and for an underalaying TABLE
[default], so we don't actually need 'foreign-default-reference'
'construct' here. Other requirements for 'common [default]' might prove
more difficult to implement, but for me this is quite sufficient.

--
-R

В списке pgsql-general по дате отправления:

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: about the RULE system
Следующее
От: Marc Evans
Дата:
Сообщение: 8.2 server core dump