pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #16730: Create table like with inheritance and self referencing index
5+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2020-11-19 97390fe8a6 87ab464219 c690ebbefa 159b6775fa 6631d5f261 513db7b700 98f3f1d5c1 Further fixes for CREATE TABLE LIKE: cope with self-referential FKs.
* BUG #16730: Create table like with inheritance and self referencing index
@ 2020-11-19 15:41 PG Bug reporting form <noreply@postgresql.org>
2020-11-19 20:10 ` Re: BUG #16730: Create table like with inheritance and self referencing index Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: PG Bug reporting form @ 2020-11-19 15:41 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: sofoklis24@gmail.com
The following bug has been logged on the website:
Bug reference: 16730
Logged by: Sofoklis Papasofokli
Email address: sofoklis24@gmail.com
PostgreSQL version: 10.15
Operating system: PostgreSQL 10.15 (Ubuntu 10.15-1.pgdg20.04+1) on
Description:
The following simplified example used to work on previous versions, but not
on 10.15, we tested it again on version 10.11 and it works.
We read in the release notes of 10.15 that there is a change when using like
with inheritance, maybe it is related.
CREATE TABLE id_base
(
id SERIAL PRIMARY KEY
);
CREATE TABLE inherited_table
(
LIKE id_base INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING
INDEXES,
"self_ref_if" INT,
CONSTRAINT self_ref_id_fk FOREIGN KEY ("self_ref_if")
REFERENCES inherited_table (id) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT
)
INHERITS (id_base);
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #16730: Create table like with inheritance and self referencing index
2020-11-19 15:41 BUG #16730: Create table like with inheritance and self referencing index PG Bug reporting form <noreply@postgresql.org>
@ 2020-11-19 20:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-20 10:32 ` Re: BUG #16730: Create table like with inheritance and self referencing index Sofoklis Papasofokli <sofoklis24@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2020-11-19 20:10 UTC (permalink / raw)
To: sofoklis24@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> The following simplified example used to work on previous versions, but not
> on 10.15, we tested it again on version 10.11 and it works.
Hmph. Apparently I was too careless about the order of execution of
the sub-commands created by a LIKE clause.
I pushed this patch:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=513db7b7004c8d1fa15dea4747a32cbc8f9621...
which takes care of the particular case you show, but now I wonder
if there are other issues lurking nearby. If you're in a position
to test this and see if it fixes your real application, please do.
Thanks for the report!
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #16730: Create table like with inheritance and self referencing index
2020-11-19 15:41 BUG #16730: Create table like with inheritance and self referencing index PG Bug reporting form <noreply@postgresql.org>
2020-11-19 20:10 ` Re: BUG #16730: Create table like with inheritance and self referencing index Tom Lane <tgl@sss.pgh.pa.us>
@ 2020-11-20 10:32 ` Sofoklis Papasofokli <sofoklis24@gmail.com>
2020-11-21 22:27 ` Re: BUG #16730: Create table like with inheritance and self referencing index Sofoklis Papasofokli <sofoklis24@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Sofoklis Papasofokli @ 2020-11-20 10:32 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
Hi Tom,
Thanks for the quick response.
I have not done a patch before, I will try to figure it out over the
weekend and get back to you on how it works for our exact scenario.
Thanks again!
Best regards,
Sofoklis
On Thu, Nov 19, 2020 at 10:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > The following simplified example used to work on previous versions, but
> not
> > on 10.15, we tested it again on version 10.11 and it works.
>
> Hmph. Apparently I was too careless about the order of execution of
> the sub-commands created by a LIKE clause.
>
> I pushed this patch:
>
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=513db7b7004c8d1fa15dea4747a32cbc8f9621...
>
> which takes care of the particular case you show, but now I wonder
> if there are other issues lurking nearby. If you're in a position
> to test this and see if it fixes your real application, please do.
>
> Thanks for the report!
>
> regards, tom lane
>
--
Sofoklis
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #16730: Create table like with inheritance and self referencing index
2020-11-19 15:41 BUG #16730: Create table like with inheritance and self referencing index PG Bug reporting form <noreply@postgresql.org>
2020-11-19 20:10 ` Re: BUG #16730: Create table like with inheritance and self referencing index Tom Lane <tgl@sss.pgh.pa.us>
2020-11-20 10:32 ` Re: BUG #16730: Create table like with inheritance and self referencing index Sofoklis Papasofokli <sofoklis24@gmail.com>
@ 2020-11-21 22:27 ` Sofoklis Papasofokli <sofoklis24@gmail.com>
2020-11-21 22:34 ` Re: BUG #16730: Create table like with inheritance and self referencing index Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Sofoklis Papasofokli @ 2020-11-21 22:27 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
Hi Tom,
Just writing to confirm that i managed to patch the 10.15 version with your
fix and run all our scripts.
Everything runs normally.
Thanks for the great work!
On Fri, Nov 20, 2020 at 12:32 PM Sofoklis Papasofokli <sofoklis24@gmail.com>
wrote:
> Hi Tom,
>
> Thanks for the quick response.
>
> I have not done a patch before, I will try to figure it out over the
> weekend and get back to you on how it works for our exact scenario.
>
> Thanks again!
>
> Best regards,
> Sofoklis
>
> On Thu, Nov 19, 2020 at 10:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> PG Bug reporting form <noreply@postgresql.org> writes:
>> > The following simplified example used to work on previous versions, but
>> not
>> > on 10.15, we tested it again on version 10.11 and it works.
>>
>> Hmph. Apparently I was too careless about the order of execution of
>> the sub-commands created by a LIKE clause.
>>
>> I pushed this patch:
>>
>>
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=513db7b7004c8d1fa15dea4747a32cbc8f9621...
>>
>> which takes care of the particular case you show, but now I wonder
>> if there are other issues lurking nearby. If you're in a position
>> to test this and see if it fixes your real application, please do.
>>
>> Thanks for the report!
>>
>> regards, tom lane
>>
>
>
> --
> Sofoklis
>
--
Sofoklis
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #16730: Create table like with inheritance and self referencing index
2020-11-19 15:41 BUG #16730: Create table like with inheritance and self referencing index PG Bug reporting form <noreply@postgresql.org>
2020-11-19 20:10 ` Re: BUG #16730: Create table like with inheritance and self referencing index Tom Lane <tgl@sss.pgh.pa.us>
2020-11-20 10:32 ` Re: BUG #16730: Create table like with inheritance and self referencing index Sofoklis Papasofokli <sofoklis24@gmail.com>
2020-11-21 22:27 ` Re: BUG #16730: Create table like with inheritance and self referencing index Sofoklis Papasofokli <sofoklis24@gmail.com>
@ 2020-11-21 22:34 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2020-11-21 22:34 UTC (permalink / raw)
To: Sofoklis Papasofokli <sofoklis24@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Sofoklis Papasofokli <sofoklis24@gmail.com> writes:
> Just writing to confirm that i managed to patch the 10.15 version with your
> fix and run all our scripts.
> Everything runs normally.
Great, thanks for testing!
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2020-11-21 22:34 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 15:41 BUG #16730: Create table like with inheritance and self referencing index PG Bug reporting form <noreply@postgresql.org>
2020-11-19 20:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-20 10:32 ` Sofoklis Papasofokli <sofoklis24@gmail.com>
2020-11-21 22:27 ` Sofoklis Papasofokli <sofoklis24@gmail.com>
2020-11-21 22:34 ` Tom Lane <tgl@sss.pgh.pa.us>
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