pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14341: insert on conflict (key_column) cann't used with partition table.
4+ messages / 3 participants
[nested] [flat]

* BUG #14341: insert on conflict (key_column) cann't used with partition table.
@ 2016-09-27 12:19 digoal@126.com
  2016-09-27 13:04 ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: digoal@126.com @ 2016-09-27 12:19 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14341
Logged by:          Zhou Digoal
Email address:      digoal@126.com
PostgreSQL version: 9.6rc1
Operating system:   CentOS 6.x x64
Description:        

```
postgres=# \d test
               Table "postgres.test"
  Column  |            Type             | Modifiers 
----------+-----------------------------+-----------
 id       | integer                     | not null
 info     | text                        | 
 crt_time | timestamp without time zone | 
Indexes:
    "test_pkey" PRIMARY KEY, btree (id)
Number of child tables: 100 (Use \d+ to list them.)

postgres=# insert into test(id,info,crt_time) values(1, md5(random()::text),
now()) on conflict (id) do update set
info=excluded.info,crt_time=excluded.crt_time;
ERROR:  XX000: unexpected failure to find arbiter index
LOCATION:  ExecCheckIndexConstraints, execIndexing.c:594
```


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #14341: insert on conflict (key_column) cann't used with partition table.
  2016-09-27 12:19 BUG #14341: insert on conflict (key_column) cann't used with partition table. digoal@126.com
@ 2016-09-27 13:04 ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-09-28 09:16   ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. 德哥 <digoal@126.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-09-27 13:04 UTC (permalink / raw)
  To: digoal@126.com; +Cc: pgsql-bugs

digoal@126.com writes:
> postgres=# \d test
>                Table "postgres.test"
>   Column  |            Type             | Modifiers 
> ----------+-----------------------------+-----------
>  id       | integer                     | not null
>  info     | text                        | 
>  crt_time | timestamp without time zone | 
> Indexes:
>     "test_pkey" PRIMARY KEY, btree (id)
> Number of child tables: 100 (Use \d+ to list them.)

> postgres=# insert into test(id,info,crt_time) values(1, md5(random()::text),
> now()) on conflict (id) do update set
> info=excluded.info,crt_time=excluded.crt_time;
> ERROR:  XX000: unexpected failure to find arbiter index
> LOCATION:  ExecCheckIndexConstraints, execIndexing.c:594

Can't reproduce that on the basis of the given information.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #14341: insert on conflict (key_column) cann't used with partition table.
  2016-09-27 12:19 BUG #14341: insert on conflict (key_column) cann't used with partition table. digoal@126.com
  2016-09-27 13:04 ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-09-28 09:16   ` 德哥 <digoal@126.com>
  2016-09-28 12:37     ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: 德哥 @ 2016-09-28 09:16 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs



$ git clone https://github.com/postgrespro/pg_pathman
$ cd pg_pathman
$ export PATH=/home/digoal/pgsql9.6rc1/bin:$PATH
$ make USE_PGXS=1
$ make install USE_PGXS=1

$ vi $PGDATA/postgresql.conf
shared_preload_libraries='pg_pathman'

$ pg_ctl restart -m fast

$ psql
postgres=# create extension pg_pathman;
CREATE EXTENSION
$ psql
postgres=# drop table test;
postgres=# create table test(id int primary key, info text, crt_time timestamptz);
CREATE TABLE
postgres=# 
postgres=# select create_range_partitions('test'::regclass, 'id', 1, 20000000, 100, false);
 create_range_partitions 
-------------------------
                     100
(1 row)
postgres=# select disable_parent('test'::regclass);
 disable_parent 
----------------

(1 row)

reconnect  
postgres=# explain select * from test where id=1;
                                   QUERY PLAN                                    
---------------------------------------------------------------------------------
 Append  (cost=0.15..2.17 rows=1 width=44)
   ->  Index Scan using test_1_pkey on test_1  (cost=0.15..2.17 rows=1 width=44)
         Index Cond: (id = 1)
(3 rows)
insert into test(id,info,crt_time) values(:id, md5(random()::text), now()) on conflict (id) do update set info=excluded.info,crt_time=excluded.crt_time;





--
公益是一辈子的事,I'm Digoal,Just Do It.




At 2016-09-27 21:04:34, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>digoal@126.com writes:
>> postgres=# \d test
>>                Table "postgres.test"
>>   Column  |            Type             | Modifiers 
>> ----------+-----------------------------+-----------
>>  id       | integer                     | not null
>>  info     | text                        | 
>>  crt_time | timestamp without time zone | 
>> Indexes:
>>     "test_pkey" PRIMARY KEY, btree (id)
>> Number of child tables: 100 (Use \d+ to list them.)
>
>> postgres=# insert into test(id,info,crt_time) values(1, md5(random()::text),
>> now()) on conflict (id) do update set
>> info=excluded.info,crt_time=excluded.crt_time;
>> ERROR:  XX000: unexpected failure to find arbiter index
>> LOCATION:  ExecCheckIndexConstraints, execIndexing.c:594
>
>Can't reproduce that on the basis of the given information.
>
>			regards, tom lane


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #14341: insert on conflict (key_column) cann't used with partition table.
  2016-09-27 12:19 BUG #14341: insert on conflict (key_column) cann't used with partition table. digoal@126.com
  2016-09-27 13:04 ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. Tom Lane <tgl@sss.pgh.pa.us>
  2016-09-28 09:16   ` Re: BUG #14341: insert on conflict (key_column) cann't used with partition table. 德哥 <digoal@126.com>
@ 2016-09-28 12:37     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2016-09-28 12:37 UTC (permalink / raw)
  To: 德哥 <digoal@126.com>; +Cc: pgsql-bugs

=?GBK?B?tcK45w==?= <digoal@126.com> writes:
> At 2016-09-27 21:04:34, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> Can't reproduce that on the basis of the given information.

> $ git clone https://github.com/postgrespro/pg_pathman
> ...

If it requires pathman, and apparently not even the default settings for
that, I'd say this is a pathman bug.  It looks a bit like the partitions
are getting processed despite the plan claiming they aren't.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-09-28 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27 12:19 BUG #14341: insert on conflict (key_column) cann't used with partition table. digoal@126.com
2016-09-27 13:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-09-28 09:16   ` 德哥 <digoal@126.com>
2016-09-28 12:37     ` Tom Lane <tgl@sss.pgh.pa.us>

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