Re: Plans for partitioning of inheriting tables - Mailing list pgsql-general

From Thiemo Kellner
Subject Re: Plans for partitioning of inheriting tables
Date
Msg-id 97798840-f7e0-4d6d-8326-1c2043e9cde9@gelassene-pferde.biz
Whole thread Raw
In response to Re: Plans for partitioning of inheriting tables  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
My bad. I was expecting primary and unique to be mentioned here, so I did not read on.


**INCLUDING CONSTRAINTS***
**#[https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-LIKE-OPT-CONSTRAINTS]*

/*CHECK*// constraints will be copied. No distinction is made between column constraints and table constraints.
Not-nullconstraints are always copied to the new table./ 


02.11.2024 00:53:53 Adrian Klaver <adrian.klaver@aklaver.com>:

> On 11/1/24 16:10, thiemo@gelassene-pferde.biz wrote:
>> Adrian Klaver <adrian.klaver@aklaver.com> escribió:
>> On 11/1/24 13:47, Thiemo Kellner wrote:
>>>> It looks to me basically to be a "create table A as select * from B where false".
>>>
>>> No it more capable then that.
>> Yes, I wrote basically, not exactly.
>> CREATE TABLE <some_tbl> LIKE <some_other_tbl> has  like_option which allows to transfer over more attributes of the
table,for example defaults, constraints, indexes, etc. 
>> But, to my understanding, no primary nor unique nor foreign constraint.
>>
>
>
> "INCLUDING INDEXES
>
>      Indexes, PRIMARY KEY, UNIQUE, and EXCLUDE constraints on the original table will be created on the new table.
Namesfor the new indexes and constraints are chosen according to the default rules, regardless of how the originals
werenamed. (This behavior avoids possible duplicate-name failures for the new indexes.) 
> "
>
> FK's are not in the the INCLUDINGs, nor triggers.
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Plans for partitioning of inheriting tables
Next
From: Ian J Cottee
Date:
Subject: Re: Random memory related errors on live postgres 14.13 instance on Ubuntu 22.04 LTS