pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Peter Braggio <pbraggio@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Partitioning: INSERT 0 0 but want INSERT 0 1
Date: Tue, 13 May 2008 17:57:55 +1930
Message-ID: <a722ba580805121527l3886589bl5a9cff41d4717bc@mail.gmail.com> (raw)
In-Reply-To: <d4e11e980805120918v3e225defm7f6d48a722cecfdb@mail.gmail.com>
References: <d4e11e980805120918v3e225defm7f6d48a722cecfdb@mail.gmail.com>

I have the same problem in PG 8.2

To resolve this issue I had to create a new table with the same
structure than the partitioned table with a trigger for insert and
update. All the operations the application have to do are directed to
this new table.

When a new record is inserted in the new table the trigger insert a
new record with the same values into the partitioned table and then
delete all records from this new table. In updates operations the
trigger redirect the operation to the partitioned table too.

With this _not elegant_ solution our Java application is able to do its job.

If you find a better solution please let me know.

----
Neil Peter Braggio
pbraggio@gmail.com


On Tue, May 13, 2008 at 11:48 AM, Nikolas Everett <nik9000@gmail.com> wrote:
> I figure this subject belongs on the performance mailing list because it is
> about partitioning, which is a performance issue.
>
> I'm working on partitioning some of the tables used by an application that
> uses OpenJPA.  It turns out that OpenJPA is sensitive to the numbers
> returned when you do an insert.  So I put together a test and attached it.
> My postgres version is 8.3.1 compiled from source.
>
> My problem is that this:
> test=> INSERT INTO ttt (a, b) VALUES ('5-5-08', 'test11212');
> INSERT 0 0
> Time: 21.646 ms
> needs to show:
> INSERT 0 1
>
> or OpenJPA will not accept it.  The insert works, but OpenJPA does not
> believe it and aborts the current transaction.
>
> Is it possible to have partitioning and have insert show the right number of
> rows inserted?
>
> Thanks,
>
> --Nik
>
>
>  --
>  Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
>  To make changes to your subscription:
>  http://www.postgresql.org/mailpref/pgsql-performance
>
>



view thread (3+ messages)  latest in thread

Message-ID: <a722ba580805121527l3886589bl5a9cff41d4717bc@mail.gmail.com>
Permalink:  ../a722ba580805121527l3886589bl5a9cff41d4717bc@mail.gmail.com/
Also on:    postgresql.org/message-id/a722ba580805121527l3886589bl5a9cff41d4717bc@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pbraggio@gmail.com
  Subject: Re: Partitioning: INSERT 0 0 but want INSERT 0 1
  In-Reply-To: <a722ba580805121527l3886589bl5a9cff41d4717bc@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox