X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6C292528B2 for ; Mon, 20 Jun 2005 06:34:08 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93795-08 for ; Mon, 20 Jun 2005 09:34:04 +0000 (GMT) Received: from twist.cefriel.it (twist.cefriel.it [131.175.53.12]) by svr1.postgresql.org (Postfix) with ESMTP id 6B9C45282C for ; Mon, 20 Jun 2005 06:34:02 -0300 (ADT) Received: from mail.cefriel.it ([131.175.53.10]) by twist.cefriel.it with Microsoft SMTPSVC(6.0.3790.211); Mon, 20 Jun 2005 11:33:51 +0200 Received: from mwlab07 ([10.10.4.25]) by mail.cefriel.it with Microsoft SMTPSVC(6.0.3790.211); Mon, 20 Jun 2005 11:33:51 +0200 From: "Luca Rasconi" To: Cc: Subject: FW: help with serial Date: Mon, 20 Jun 2005 11:33:51 +0200 Message-ID: <000901c5757b$2b3b7030$19040a0a@cefriel.it> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01C5758B.EEC44030" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-OriginalArrivalTime: 20 Jun 2005 09:33:51.0662 (UTC) FILETIME=[2B3AACE0:01C5757B] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.253 tagged_above=0 required=5 tests=AWL, HTML_90_100, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200506/250 X-Sequence-Number: 21851 This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C5758B.EEC44030 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all, There's a behaviour I can't understand!!!! There is table TABLE_A with 3 columns (uid, id, session) where uid is the pk and the data type is serial. There is table TABLE_B with 3 columns (uid, ts_col, col) where uid is the pk. On table TABLE_A I have a rule on insert like this: CREATE OR REPLACE RULE r1 AS ON INSERT TO TABLE_A DO INSERT INTO TABLE_B (uid) VALUES ((new.uid)); Till now. ok. When I do an insert insert into TABLE_A ("id", "session") values (7, 'aaaaaaaaaaaaa'); I have this row, In table TABLE_A 37; 7; "aaaaaaaaaaaaa" while in table TABLE_B 38; ""; "" how is it possible, why in a table 37 and in the other 37 + 1? Thank you, Luca ------=_NextPart_000_000A_01C5758B.EEC44030 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi = all,

There’s a behaviour I can’t = understand!!!!

There is table TABLE_A with 3 columns (uid, id, = session) where uid is the pk and the data type is = serial.

There is table TABLE_B with 3 columns (uid, ts_col, = col) where uid is the pk.

 

On table TABLE_A I have a rule on insert like = this:

 

CREATE OR REPLACE RULE r1 = AS

    = ON INSERT TO TABLE_A DO  = INSERT INTO TABLE_B (uid)

  VALUES ((new.uid));

 

Till now… = ok…

When I do an insert

insert into TABLE_A ("id", = "session") values (7, 'aaaaaaaaaaaaa');

 

I have this row,

In table TABLE_A

37; 7; = "aaaaaaaaaaaaa"

 

while in table TABLE_B

38; ""; = ""

 

how is it possible, why in a table 37 and in the = other 37 + 1?

 

Thank you,

Luca

 

 

 

------=_NextPart_000_000A_01C5758B.EEC44030--