Re: Question about accessing partitions whose name includes the schema name and a period - is this correct?

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: Question about accessing partitions whose name includes the schema name and a period - is this correct?
Дата
Msg-id 1692955914.591234.1681953529723@office.mailbox.org
обсуждение исходный текст
Ответ на Re: Question about accessing partitions whose name includes the schema name and a period - is this correct?  (Jay Stanley <beansboy@cruzio.com>)
Список pgsql-general
> On 20/04/2023 00:50 CEST Jay Stanley <beansboy@cruzio.com> wrote:
>
> postgres=# alter table my_schema.my_table drop partition "my_schema"."my_schema.my_table_should_not_work";
> ERROR: syntax error at or near ""my_schema""
> LINE 1: alter table my_schema.my_table drop partition "my_schema"."m...
>                                                        ^
> -or-
> postgres=# alter table my_schema.my_table drop partition my_schema."my_schema.my_table_should_not_work";
> ERROR: syntax error at or near "my_schema"
> LINE 1: alter table my_schema.my_table drop partition my_schema."my_...

The command you're looking for is ALTER TABLE DETACH PARTITION.

DROP PARTITION means dropping the column named "partition".  The syntax error
comes from the parser expecting an optional CASCADE or RESTRICT after DROP PARTITION.

--
Erik



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: What happened to the tip "It is good practice to create a role that has the CREATEDB and CREATEROLE privileges..."
Следующее
От: "jacktby@gmail.com"
Дата:
Сообщение: How does pg index page optimize dead tuples?