Hengky Lie wrote:

I have 2 tables : tblmasdbt and tblmasgl.
I want on every record insertion in tblmasdbt, that record also
automatically insert into tblmasdbt. I need only 2 related field.

You probably want triggers rather than rules, but anyway.

CREATE RULE "rule1" AS ON INSERT TO "public"."tblmasdbt" DO (insert into tblmasgl (KODEGL,NAMAREK) VALUES (new.KODEGL, new.NAMAREK));

But I always get this error :

ERROR:  column "kodegl" of relation "tblmasgl" does not exist

There is not a column called kodegl on table tblmasgl.

Here is the Table Structure

CREATE TABLE "public"."tblmasgl" (
"KODEGL" VARCHAR(15) NOT NULL,

There you go - you double-quoted the column-name when creating the table. That means that it is literally "KODEGL" and will not match kodegl or KoDeGl or any other combination of upper and lower case.

If you double-quote column-names when you create a table you'll want to double-quote them every time you use them too.

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to