pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15283: Query Result equal 0 for partitioned table
4+ messages / 3 participants
[nested] [flat]
* BUG #15283: Query Result equal 0 for partitioned table
@ 2018-07-18 12:59 PG Bug reporting form <noreply@postgresql.org>
2018-07-19 04:44 ` Re: BUG #15283: Query Result equal 0 for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
0 siblings, 1 reply; 4+ messages in thread
From: PG Bug reporting form @ 2018-07-18 12:59 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: suan.tay@gmail.com
The following bug has been logged on the website:
Bug reference: 15283
Logged by: Suan Tay
Email address: suan.tay@gmail.com
PostgreSQL version: 9.6.9
Operating system: Ubuntu 16,17
Description:
Hello,
Result of data insertion is alway at 0 when the table is partitionned.
I use Sorm as JPA in my Java App, it cacht the result and as it's equal to 0
it send to Error.
I solved this issue with SimpleORM but it's not the reel issue.
I also test the Postgresql 10.
Regards
ST
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #15283: Query Result equal 0 for partitioned table
2018-07-18 12:59 BUG #15283: Query Result equal 0 for partitioned table PG Bug reporting form <noreply@postgresql.org>
@ 2018-07-19 04:44 ` Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
2018-07-23 08:04 ` Re: BUG #15283: Query Result equal 0 for partitioned table suan tay <suan.tay@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Amit Langote @ 2018-07-19 04:44 UTC (permalink / raw)
To: suan.tay@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
On 2018/07/18 21:59, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 15283
> Logged by: Suan Tay
> Email address: suan.tay@gmail.com
> PostgreSQL version: 9.6.9
> Operating system: Ubuntu 16,17
> Description:
>
> Hello,
> Result of data insertion is alway at 0 when the table is partitionned.
What do you mean by "result is 0"? Is it "INSERT 0 0" that you're
referring to?
You reported this for 9.6.9 which doesn't have native partitioning. So,
you may have set up a trigger on the parent table to redirect INSERT on it
to INSERT into child tables / partitions. If that's so, then because of
such a trigger, nothing would be actually inserted into the parent table,
so the result is INSERT 0 0.
> I use Sorm as JPA in my Java App, it cacht the result and as it's equal to 0
> it send to Error.
> I solved this issue with SimpleORM but it's not the reel issue.
>
> I also test the Postgresql 10.
If you tried to use native partitioned table (CREATE TABLE with PARTITION
BY clause) in Postgres 10, then this shouldn't happen. Inserts into
parent are still redirected to child tables / partitions, but no triggers
are involved, so the result shows the actual count of rows inserted. For
example, if you insert 1 row into the partitioned table (parent), you will
get INSERT 0 1 as a result.
But if you didn't use native partitioned table, but used the same old
method of using triggers as 9.6, you will see the same behavior as
described above for 9.6.
Thanks,
Amit
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #15283: Query Result equal 0 for partitioned table
2018-07-18 12:59 BUG #15283: Query Result equal 0 for partitioned table PG Bug reporting form <noreply@postgresql.org>
2018-07-19 04:44 ` Re: BUG #15283: Query Result equal 0 for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
@ 2018-07-23 08:04 ` suan tay <suan.tay@gmail.com>
2018-07-23 08:19 ` Re: BUG #15283: Query Result equal 0 for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
0 siblings, 1 reply; 4+ messages in thread
From: suan tay @ 2018-07-23 08:04 UTC (permalink / raw)
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>; +Cc: pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Thank you for the clarification.
Yes in deed I'm using rules to do such partitioning in Posgresql 9.6.
I also test Postgres 10 with rules : the result of insertion is always at 0.
As you explain, it's throw that in the madder table isn't any insertion but
for the app the partitioning has to be completely transparent.
But I don't test CREATE TABLE with PARTITION BY clause . That may solve the
issue I have but I have to change all the app part because of the different
way to do PARTITIONING
I will do .
Many Thanks.
Regards.
ST
Le jeu. 19 juil. 2018 à 06:44, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
a écrit :
> On 2018/07/18 21:59, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference: 15283
> > Logged by: Suan Tay
> > Email address: suan.tay@gmail.com
> > PostgreSQL version: 9.6.9
> > Operating system: Ubuntu 16,17
> > Description:
> >
> > Hello,
> > Result of data insertion is alway at 0 when the table is partitionned.
>
> What do you mean by "result is 0"? Is it "INSERT 0 0" that you're
> referring to?
>
> You reported this for 9.6.9 which doesn't have native partitioning. So,
> you may have set up a trigger on the parent table to redirect INSERT on it
> to INSERT into child tables / partitions. If that's so, then because of
> such a trigger, nothing would be actually inserted into the parent table,
> so the result is INSERT 0 0.
>
> > I use Sorm as JPA in my Java App, it cacht the result and as it's equal
> to 0
> > it send to Error.
> > I solved this issue with SimpleORM but it's not the reel issue.
> >
> > I also test the Postgresql 10.
>
> If you tried to use native partitioned table (CREATE TABLE with PARTITION
> BY clause) in Postgres 10, then this shouldn't happen. Inserts into
> parent are still redirected to child tables / partitions, but no triggers
> are involved, so the result shows the actual count of rows inserted. For
> example, if you insert 1 row into the partitioned table (parent), you will
> get INSERT 0 1 as a result.
>
> But if you didn't use native partitioned table, but used the same old
> method of using triggers as 9.6, you will see the same behavior as
> described above for 9.6.
>
> Thanks,
> Amit
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #15283: Query Result equal 0 for partitioned table
2018-07-18 12:59 BUG #15283: Query Result equal 0 for partitioned table PG Bug reporting form <noreply@postgresql.org>
2018-07-19 04:44 ` Re: BUG #15283: Query Result equal 0 for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
2018-07-23 08:04 ` Re: BUG #15283: Query Result equal 0 for partitioned table suan tay <suan.tay@gmail.com>
@ 2018-07-23 08:19 ` Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
0 siblings, 0 replies; 4+ messages in thread
From: Amit Langote @ 2018-07-23 08:19 UTC (permalink / raw)
To: suan tay <suan.tay@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
On 2018/07/23 17:04, suan tay wrote:
> Thank you for the clarification.
>
> Yes in deed I'm using rules to do such partitioning in Posgresql 9.6.
> I also test Postgres 10 with rules : the result of insertion is always at 0.
I forgot to mention that using rules (not triggers) would lead to the same
behavior.
Thanks,
Amit
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2018-07-23 08:19 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 12:59 BUG #15283: Query Result equal 0 for partitioned table PG Bug reporting form <noreply@postgresql.org>
2018-07-19 04:44 ` Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
2018-07-23 08:04 ` suan tay <suan.tay@gmail.com>
2018-07-23 08:19 ` Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
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