Re: BUG #17009: create temporary table with like option using same name as persistent table does not create indexes

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #17009: create temporary table with like option using same name as persistent table does not create indexes
Дата
Msg-id CAApHDvpxmRbTBYfJvZCcSEP5eO4CHZiZ9KdY6zyBxhx8hOx=cQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #17009: create temporary table with like option using same name as persistent table does not create indexes  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17009: create temporary table with like option using same name as persistent table does not create indexes  (Нагель Михаил <Misha_Nagel@mail.ru>)
Список pgsql-bugs
On Fri, 14 May 2021 at 21:08, PG Bug reporting form
<noreply@postgresql.org> wrote:
> 12.5 output:
> ce2pg2=> create table t_tmp (a int);
> CREATE TABLE
> ce2pg2=> create index on t_tmp (a);
> CREATE INDEX
> ce2pg2=> create temporary table t_tmp (like t_tmp including all);
> CREATE TABLE
> ce2pg2=> select *
> ce2pg2-> from pg_catalog.pg_indexes
> ce2pg2-> where tablename  like 't_tmp%';
>  schemaname | tablename |  indexname  | tablespace |
> indexdef
> ------------+-----------+-------------+------------+---------------------------------------------------------
>  test2      | t_tmp     | t_tmp_a_idx |            | CREATE INDEX
> t_tmp_a_idx ON public.t_tmp USING btree (a)

If you upgrade to 12.6 or 12.7, does it work?

https://www.postgresql.org/docs/12/release-12-6.html mentions:

> Prevent misprocessing of ambiguous CREATE TABLE LIKE clauses (Tom Lane)
> A LIKE clause is re-examined after initial creation of the new table, to handle importation of indexes and such. It
waspossible for this re-examination to find a different table of the same name, causing unexpected behavior; one
exampleis where the new table is a temporary table of the same name as the LIKE target." 

This sounds like it might fix the issue.

David



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17009: create temporary table with like option using same name as persistent table does not create indexes
Следующее
От: Eric Thinnes
Дата:
Сообщение: Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)