Re: Relation wide 'LIKE' clause

Поиск
Список
Период
Сортировка
От Georgios
Тема Re: Relation wide 'LIKE' clause
Дата
Msg-id zcD5S3V5vieVI8QBMuhd9Qa9fFOmHFWM6S6YAi7QE_pE_En_yLs9Ldxgt_KJaAcwBQQrUVOnTBLGJDut6E3FRb-pjVNBcR2YbsYA5mRA0p4=@protonmail.com
обсуждение исходный текст
Ответ на Re: Relation wide 'LIKE' clause  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, June 10, 2020 12:08 PM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:

> On 2020-06-10 11:42, Georgios wrote:
>
> > Postgres create table statement supports `LIKE source_table [like_option... ]`
> > to specify `a table from which the new table automatically copies all column names, their data types, and their
not-nullconstraints.` according to 
> > documentation [1].
> > I am wondering if a similar clause would make sense to copy relation wide
> > settings. For example consider a relation created like this:
> > `CREATE TABLE source_table ([column, ...]) USING customam WITH (storage_parameter1 = value1, ... )`
>
> We already have LIKE INCLUDING STORAGE. Maybe that should just be
> updated to work like what you are asking for.

This is correct. However I do see some limitations there. Consider the valid scenario:

`CREATE TABLE target (LIKE source_am1 INCLUDING ALL, LIKE source_am2 INCLUDING ALL)`

Which source relation should be used for the access method and storage parameters?

Also I _think_ that the current `LIKE` clause specifically targets column definitions
in the SQL standard. I am a bit hesitant on the last part, yet this is my
current understanding.

Please, let me know what you think.

>
> ------------------------------------------------------------------------------------------------------------------
>
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Relation wide 'LIKE' clause
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions