pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedClarification regarding CREATE TABLE LIKE and FOREIGN KEYS
4+ messages / 4 participants
[nested] [flat]
* Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS
@ 2023-11-27 15:05 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 4+ messages in thread
From: PG Doc comments form @ 2023-11-27 15:05 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: david@robbez.com
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/16/sql-createtable.html
Description:
It is not clear to me that foreign keys are copied or not when duplicating a
table using CREATE TABLE ... LIKE ... INCLUDING ALL. I had to actually test
to check what it does.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS
@ 2023-11-29 15:24 Euler Taveira <euler@eulerto.com>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 4+ messages in thread
From: Euler Taveira @ 2023-11-29 15:24 UTC (permalink / raw)
To: david@robbez.com; pgsql-docs@lists.postgresql.org
On Mon, Nov 27, 2023, at 12:05 PM, PG Doc comments form wrote:
> It is not clear to me that foreign keys are copied or not when duplicating a
> table using CREATE TABLE ... LIKE ... INCLUDING ALL. I had to actually test
> to check what it does.
>
It is impractical to add what a feature *does not* provide in general. The
probability that that information will be obsolete (due to new features) is
high. If the information is missing that's because it is not supported. (Of
course, it can be an omission and, in this case, we need to fix it.)
--
Euler Taveira
EDB https://www.enterprisedb.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS
@ 2023-12-01 12:08 David Virebayre <david@robbez.com>
parent: Euler Taveira <euler@eulerto.com>
0 siblings, 1 reply; 4+ messages in thread
From: David Virebayre @ 2023-12-01 12:08 UTC (permalink / raw)
To: Euler Taveira <euler@eulerto.com>; +Cc: pgsql-docs@lists.postgresql.org
Le mer. 29 nov. 2023 à 16:24, Euler Taveira <euler@eulerto.com> a écrit :
> On Mon, Nov 27, 2023, at 12:05 PM, PG Doc comments form wrote:
>
> It is not clear to me that foreign keys are copied or not when duplicating
> a
> table using CREATE TABLE ... LIKE ... INCLUDING ALL. I had to actually
> test
> to check what it does.
>
>
> It is impractical to add what a feature *does not* provide in general. The
> probability that that information will be obsolete (due to new features)
> is
> high. If the information is missing that's because it is not supported.
> (Of
> course, it can be an omission and, in this case, we need to fix it.)
>
"INCLUDING ALL" leads people to believe *everything* is copied.
The fact that it doesn't seem counter intuitive, at least to me.
Therefore, it doesn't seem absurd to me to warn people about what is not
copied.
I wrote the original message hoping to help improve the documentation. I
could write a draft if I'm allowed to.
I do believe that clarifying this point improves the documentation. If
there's a consensus that it doesn't, my apologies for the annoyance.
Cheers.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS
@ 2023-12-01 14:17 David G. Johnston <david.g.johnston@gmail.com>
parent: David Virebayre <david@robbez.com>
0 siblings, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2023-12-01 14:17 UTC (permalink / raw)
To: David Virebayre <david@robbez.com>; +Cc: Euler Taveira <euler@eulerto.com>; pgsql-docs@lists.postgresql.org
On Fri, Dec 1, 2023 at 7:07 AM David Virebayre <david@robbez.com> wrote:
> "INCLUDING ALL" leads people to believe *everything* is copied.
>
> The fact that it doesn't seem counter intuitive, at least to me.
>
> Therefore, it doesn't seem absurd to me to warn people about what is not
> copied.
>
> I wrote the original message hoping to help improve the documentation. I
> could write a draft if I'm allowed to.
> I do believe that clarifying this point improves the documentation. If
> there's a consensus that it doesn't, my apologies for the annoyance.
>
>
You are welcome to suggest improvements. But "all" means inclusive of
every individual item listed on that page. You don't get stuff in "all"
that you cannot specify individually and you cannot specify references
clauses individually.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-12-01 14:17 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 15:05 Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS PG Doc comments form <noreply@postgresql.org>
2023-11-29 15:24 ` Euler Taveira <euler@eulerto.com>
2023-12-01 12:08 ` David Virebayre <david@robbez.com>
2023-12-01 14:17 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox