Re: [ADMIN] create view with check option

Поиск
Список
Период
Сортировка
От Karthikeyan Sundaram
Тема Re: [ADMIN] create view with check option
Дата
Msg-id BAY131-F21596D11D9A7E65E070E4FB0760@phx.gbl
обсуждение исходный текст
Ответ на create view with check option  ("Karthikeyan Sundaram" <skarthi98@hotmail.com>)
Список pgsql-sql
Hi everybody,

   I have implemented in a different way as advised in the manual.  I
thought this will be useful for everbody.

   We don't have check option in the view.  Instead we can create a rule to
make the view as insertable, updatable or delete.

  Here is the script.

create table test_tbl (a int4, b int4, c varchar(30));

create or replace view test_vw as select * from test_tbl;

create or replace rule test_rule_ins as on insert to test_vw
do instead
insert into test_tbl values (new.a, new.b, new.c);

insert into test_vw (a, b) values (1,2);
insert into test_vw (a, b) values (3,4);

create or replace rule test_rule_upd as on update to test_vw
do instead
update test_tbl set a=new.a, b=new.b, c=new.c where a=new.a;


update test_vw set c='good' where a=1;

select * from test_vw;


regards
skarthi

>From: "Karthikeyan Sundaram" <skarthi98@hotmail.com>
>To: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org
>Subject: [ADMIN] create view with check option
>Date: Sun, 18 Mar 2007 22:38:05 -0700
>
>Hi Everybody,
>
>    I have 2 versions of postgres 8.1.0 is my production version and 8.2.1
>is my development version.
>
>  I am trying to create a view in my development version (8.2.3)
>
>   create view chnl_vw as select * from channel with check option;
>
>   I am getting an error message:
>
>[Error] Script lines: 1-1 --------------------------
>ERROR: WITH CHECK OPTION is not implemented
>Line: 1
>
>   what does this mean?  I looked at the 8.2.1 manual and found the create
>view has check option.  But it says before 8.2 those options are
>unsupported.
>
>   How can I make this command to work.
>
>Regards
>skarthi
>
>_________________________________________________________________
>5.5%* 30 year fixed mortgage rate. Good credit refinance. Up to 5 free
>quotes - *Terms

>https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5d&s=4056&p=5117&disc=y&vers=910
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: explain analyze is your friend

_________________________________________________________________
i'm making a difference.�Make every IM count for the cause of your choice.
Join Now.

http://clk.atdmt.com/MSN/go/msnnkwme0080000001msn/direct/01/?href=http://im.live.com/messenger/im/home/?source=hmtagline


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

Предыдущее
От: Jure Kodzoman
Дата:
Сообщение: Re: Encode
Следующее
От: Martin Marques
Дата:
Сообщение: Re: triple self-join crawling