Re: create view with check option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
To: pgsql-admin@xxxxxxxxxxxxxx, pgsql-sql@xxxxxxxxxxxxxx
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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux