Detach partition with constraint test

Started by Ashutosh Bapatover 1 year ago2 messageshackers

Thread notes

1 note#tests-build
hackorum-bot#tests-build
hackorum-bot
1 day ago

@global #tests-build

#tests-build
Jump to latest
#1Ashutosh Bapat
ashutosh.bapat.oss@gmail.com

Hi,
I tested the "not enforced" constraint feature extensively today
especially the cases of partitioned table. Everything seems to be
working fine.

While doing that, I found that foreign_key.sql does not have a test to
make sure that a partition continues to have the constraints in the
same state after detaching. Here's a 0001 patch adding those tests in
the same block as the not enforced constraints. Probably we could add
similar test in other blocks as well, but I haven't done that yet.
Checking if something like this would be acceptable.

0002 fixes a comment in the same block.

--
Best Wishes,
Ashutosh Bapat

Attachments:

t51359_1
0001-Test-detaching-a-partition-with-foreign-key-20250403.patchtext/x-patch; charset=US-ASCII; name=0001-Test-detaching-a-partition-with-foreign-key-20250403.patchDownload+37-3
0002-Fix-an-inaccurate-comment-20250403.patchtext/x-patch; charset=US-ASCII; name=0002-Fix-an-inaccurate-comment-20250403.patchDownload+2-1
#2Amul Sul
sulamul@gmail.com
In reply to: Ashutosh Bapat (#1)
Re: Detach partition with constraint test

On Thu, Apr 3, 2025 at 5:52 PM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:

Hi,
I tested the "not enforced" constraint feature extensively today
especially the cases of partitioned table. Everything seems to be
working fine.

While doing that, I found that foreign_key.sql does not have a test to
make sure that a partition continues to have the constraints in the
same state after detaching. Here's a 0001 patch adding those tests in
the same block as the not enforced constraints. Probably we could add
similar test in other blocks as well, but I haven't done that yet.
Checking if something like this would be acceptable.

0002 fixes a comment in the same block.

Thanks for the testing; both patches look quite reasonable to me.

Regards,
Amul