From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Amit Langote <amitlangote09(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | sketchy partcollation handling |
Date: | 2017-06-02 16:31:30 |
Message-ID: | CA+Tgmoba5mtPgM3NKfG06vv8na5gGbVOj0h4zvivXQwLw8wXXQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
If you create a partitioned table in the obvious way, partcollation ends up 0:
rhaas=# create table foo (a int, b text) partition by list (a);
CREATE TABLE
rhaas=# select * from pg_partitioned_table;
partrelid | partstrat | partnatts | partattrs | partclass |
partcollation | partexprs
-----------+-----------+-----------+-----------+-----------+---------------+-----------
16420 | l | 1 | 1 | 1978 | 0 |
(1 row)
You could argue that 0 is an OK value there; offhand, I'm not sure
about that. But there's nothing in
https://www.postgresql.org/docs/10/static/catalog-pg-partitioned-table.html
which indicates that some entries can be 0 rather than a valid
collation OID. And this is definitely not OK:
rhaas=# select * from pg_depend where objid = 16420;
classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype
---------+-------+----------+------------+----------+-------------+---------
1259 | 16420 | 0 | 2615 | 2200 | 0 | n
1259 | 16420 | 0 | 3456 | 0 | 0 | n
(2 rows)
We shouldn't be storing a dependency on non-existing collation 0.
I'm not sure whether the bug here is that we should have a valid
collation OID there rather than 0, or whether the bug is that we
shouldn't be recording a dependency on anything other than a real
collation OID, but something about this is definitely not right.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2017-06-02 16:32:53 | Re: Hash Functions |
Previous Message | Bruce Momjian | 2017-06-02 16:20:15 | Re: Use of non-restart-safe storage by temp_tablespaces |