Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 455D19FB267 for ; Fri, 5 Oct 2007 01:56:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 15045-08 for ; Fri, 5 Oct 2007 01:56:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by postgresql.org (Postfix) with ESMTP id BCE099FB1EA for ; Fri, 5 Oct 2007 01:56:40 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1IdfEs1tV9-00025M; Fri, 05 Oct 2007 06:56:38 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1IdfEr-0003nt-00 for pgsql-sql@postgresql.org; Fri, 05 Oct 2007 06:56:37 +0200 Date: Fri, 5 Oct 2007 06:56:37 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Rule Error Message-ID: <20071005045637.GA14452@a-kretschmer.de> References: <20071004130011.GH15428@a-kretschmer.de> <004601c806dc$8cd85a20$6f00a8c0@hengky> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004601c806dc$8cd85a20$6f00a8c0@hengky> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX18V8+7dPvm2+GMzIcuDefXDd84+iPa3JRYvcJZ VdkBy/+l8CCGypYE0Jm4SrEJV2QnTRoCwqogMTVSnYgIZfIX4b Y29s/RSl1ELEKmQM6PSOOPC4p6k1Z2l X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/31 X-Sequence-Number: 29403 am Fri, dem 05.10.2007, um 7:16:06 +0800 mailte Hengky Lie folgendes: > Yes, it works now ! Wow, the problem is in the field name. Changed it to > lowercase solved the problem. Thank you to all ho give me this advice. > > But now I have another question regarding to this field, what command I can > use in UPDATE RULE to make these 2 fields (KODEGL and NAMAREK) keep syncron > between these 2 tables (tblmasdbt and tblmasgl) ? As Richard suggested, use TRIGGER instead RULE, but okay. A little example, i hope, it helps: (2 little tables t1 and t2 and a UPDATE-RULE on t1 with a 'do also') test=# create table t1 (id int, val int); CREATE TABLE test=*# create table t2 (id int, val int); CREATE TABLE test=*# create rule r1 as on update to t1 do also update t2 set val = new.val where id=new.id; CREATE RULE test=*# commit; COMMIT test=# insert into t1 values (1,1); INSERT 0 1 test=*# insert into t1 values (2,2); INSERT 0 1 test=*# insert into t2 values (1,1); INSERT 0 1 test=*# insert into t2 values (2,2); INSERT 0 1 test=*# update t1 set val =10 where id=1; UPDATE 1 test=*# select * from t2; id | val ----+----- 2 | 2 1 | 10 (2 rows) Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net