Re: BUG #15283: Query Result equal 0 for partitioned table

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: BUG #15283: Query Result equal 0 for partitioned table
Дата
Msg-id 4f621f53-aa87-f659-5711-22eb81a91e48@lab.ntt.co.jp
обсуждение исходный текст
Ответ на BUG #15283: Query Result equal 0 for partitioned table  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15283: Query Result equal 0 for partitioned table  (suan tay <suan.tay@gmail.com>)
Список pgsql-bugs
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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #15263: pg_dump / psql failure. When loading, psql does notsee function-based constraints or indices
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15284: SSL connection is off