From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | thiemo(at)gelassene-pferde(dot)biz, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Plans for partitioning of inheriting tables |
Date: | 2024-11-01 19:38:09 |
Message-ID: | 666c82fe-be27-4f32-99ad-8952a56f2282@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 11/1/24 12:16, thiemo(at)gelassene-pferde(dot)biz wrote:
> Thanks, I shall have a look into it. I was under the assumption the the
> create table like would create no more than a structural copy.
Not sure what you mean by structural copy, but the table created by
CREATE TABLE LIKE will not have any association with the table it was
created from.
https://www.postgresql.org/docs/current/sql-createtable.html
"Unlike INHERITS, the new table and original table are completely
decoupled after creation is complete. Changes to the original table will
not be applied to the new table, and it is not possible to include data
of the new table in scans of the original table."
>
> Torsten Förtsch <tfoertsch123(at)gmail(dot)com <mailto:tfoertsch123(at)gmail(dot)com>>
> escribió:
>
>> Thiemo,
>> it looks to me like you are using inheritance just to make sure your
>> SOURCES and TOPO_FILES tables have some common columns. If you are not
>> actually querying the TEMPLATE_TECH table and expect to see all the
>> rows from the other 2 tables in that one table combined, then you
>> could use CREATE TABLE (LIKE ...) instead of inheritance. That way
>> your "child" tables would become normal tables and you could use
>> declarative partitioning on them.
>> Even if you are querying the TEMPLATE_TECH table, you could still do
>> that by turning the TEMPLATE_TECH table into a view which performs a
>> UNION ALL over the other tables.
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Peter J. Holzer | 2024-11-01 19:56:17 | Re: Used memory calculation in containers - docker stats and file cache |
Previous Message | thiemo | 2024-11-01 19:16:00 | Re: Plans for partitioning of inheriting tables |