Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elmC4-0004km-PI for pgsql-general@arkaria.postgresql.org; Wed, 14 Feb 2018 01:49:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elmC3-0007Bb-BL for pgsql-general@arkaria.postgresql.org; Wed, 14 Feb 2018 01:49:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elmC3-0007BR-3d for pgsql-general@lists.postgresql.org; Wed, 14 Feb 2018 01:49:07 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1elmBy-0004tl-Nj for pgsql-general@postgresql.org; Wed, 14 Feb 2018 01:49:06 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id C9030B2461F5 for ; Tue, 13 Feb 2018 18:48:59 -0700 (MST) Date: Tue, 13 Feb 2018 18:48:59 -0700 (MST) From: DrakoRod To: pgsql-general@postgresql.org Message-ID: <1518572939820-0.post@n3.nabble.com> In-Reply-To: References: <1518568026195-0.post@n3.nabble.com> Subject: Re: Table Partitioning: Sequence jump issue 10 in 10 with serial datatype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sorry, your right! The example is: CREATE TABLE customers ( id serial PRIMARY KEY,=20 name TEXT, other_data TEXT ); CREATE TABLE customers_part1( CHECK (id<10000)=20 )INHERITS (customers); CREATE TABLE customers_part2( CHECK (id>=3D10000 AND id<20000)=20 )INHERITS (customers); CREATE OR REPLACE RULE inserts_customer_part1 AS ON INSERT TO customers WHERE new.id < 10000 DO INSTEAD INSERT INTO customers_part1 SELECT NEW.*; CREATE OR REPLACE RULE inserts_customer_part2 AS ON INSERT TO customers WHERE new.id >=3D 10000 AND new.id < 20000 DO INSTEAD INSERT INTO customers_part2 SELECT NEW.*; INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 INSERT INTO customers (name, other_data) VALUES ('XXXXXXx','YYYYYYYYYY');= =20 dd=3D# SELECT * FROM customers; = =20 id | name | other_data=20 ----+---------+------------ 3 | XXXXXXx | YYYYYYYYYY 7 | XXXXXXx | YYYYYYYYYY 11 | XXXXXXx | YYYYYYYYYY 15 | XXXXXXx | YYYYYYYYYY 19 | XXXXXXx | YYYYYYYYYY 23 | XXXXXXx | YYYYYYYYYY (6 rows) ----- Dame un poco de fe, eso me bastar=C3=A1. Rozvo Ware Solutions=20 -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.ht= ml