Re: Table Partitioning - Mailing list pgsql-general

From Raghavendra
Subject Re: Table Partitioning
Date
Msg-id CA+h6AhjwUnE6rgNecjRtCMZqcOUYHKHeOcC-fyAg2mgdUXbz2w@mail.gmail.com
Whole thread Raw
In response to Re: Table Partitioning  (Richard Onorato <richard_onorato@yahoo.com>)
Responses Re: Table Partitioning
List pgsql-general
On Wed, May 22, 2013 at 6:54 AM, Richard Onorato <richard_onorato@yahoo.com> wrote:
Were you able to get it to insert with the bigserial being used on the table?  

Yes.
 
Every time I go to do an insert into one of the inherited tables I am now getting the following exception:
org.hibernate.HibernateException: The database returned no natively generated identity value


Hmm, I guess you are inserting on the parent table not directly into inherited table.
Can you share the INSERT statement.
 
Is auto-increment supported on table partitioning?
 

Yes, BIGSERIAL will create a sequence that will be shared by all child partitions.
Check below example as per your test case, INSERT statement do not have BIGSERIAL column still its auto-increment and populated data in child tables. 

postgres=# insert into mymappingtable(c1,c2,c3,count,createdtime) values (9,20,30,1,now());
INSERT 0 0
postgres=# insert into mymappingtable(c1,c2,c3,count,createdtime) values (7,20,30,1,now());
INSERT 0 0
postgres=# select * from mymappingtablet5;
 id | c1 | c2 | c3 | count |           createdtime
----+----+----+----+-------+----------------------------------
  8 |  9 | 20 | 30 |     1 | 2013-05-18 02:08:33.061548+05:30 

postgres=# select * from mymappingtablet3;
 id | c1 | c2 | c3 | count |           createdtime
----+----+----+----+-------+----------------------------------
  9 |  7 | 20 | 30 |     1 | 2013-05-18 02:12:03.076529+05:30
(1 row)

(Request not to top-post please ... :)  )

---
Regards,
Raghavendra
EnterpriseDB Corporation

pgsql-general by date:

Previous
From: Dev Kumkar
Date:
Subject: Re: [ODBC] ODBC constructs
Next
From: Antonio Goméz Soto
Date:
Subject: Slow query and using wrong index, how to fix? Probably naive question..