Search Postgresql Archives

Re: Indexes mysteriously change to ON ONLY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Jan 27, 2023, at 13:01, Rumpi Gravenstein <rgravens@xxxxxxxxx> wrote:
> 
> We are using the pg_indexes view (indexdef) to retrieve the index definition.

This is as expected.  Once the index is created on the partitioned set of tables, the index on the *root* table will be ON ONLY that table; the child tables appear separately:

xof=# create table t (i bigint) partition by range(i);
CREATE TABLE
xof=# create table t001 partition of t for values from (1) to (2); 
CREATE TABLE
xof=# create index on t(i);
CREATE INDEX
xof=# select * from pg_indexes where tablename = 't';
 schemaname | tablename | indexname | tablespace |                       indexdef                        
------------+-----------+-----------+------------+-------------------------------------------------------
 public     | t         | t_i_idx   |            | CREATE INDEX t_i_idx ON ONLY public.t USING btree (i)
(1 row)

xof=# select * from pg_indexes where tablename = 't001';
 schemaname | tablename | indexname  | tablespace |                        indexdef                        
------------+-----------+------------+------------+--------------------------------------------------------
 public     | t001      | t001_i_idx |            | CREATE INDEX t001_i_idx ON public.t001 USING btree (i)
(1 row)







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux