Thread: Re: Prevent COPY FREEZE on Foreign tables
On Wed, Feb 05, 2025 at 01:05:32PM -0600, Sami Imseih wrote: >> Instead of throwing an error, how about we turn that into a warning? >> This way, if someone is batch-importing data for multiple tables, it won´t interrupt their script that generates a COPYfor each table. >> Is it better to give them a heads-up without making them modify their commands right away? > > Hmm, I prefer we error out the transaction as it can be difficult > to detect a warning and the user will assume that the > transaction completed. Also, we currently error out when > copy freeze is on a parent partition, so I rather we keep > this behavior consistent. Yeah, I'd rather error out than expect users to respond to warnings to the effect of "hey, you told us to do something, but we did something else that isn't what you asked us to do." That both retains the broken feature and adds more noise, neither of which seems desirable. -- nathan
> Yeah, I'd rather error out than expect users to respond to warnings to the > effect of "hey, you told us to do something, but we did something else that > isn't what you asked us to do." That both retains the broken feature and > adds more noise, neither of which seems desirable. I agree. Sami
On Feb 6, 2025 at 03:27 +0800, Sami Imseih <samimseih@gmail.com>, wrote:
Yeah, I'd rather error out than expect users to respond to warnings to the
effect of "hey, you told us to do something, but we did something else that
isn't what you asked us to do." That both retains the broken feature and
adds more noise, neither of which seems desirable.
I agree.
Sami
Hi,
I understand your perspective, and I'm okay with it.
Since partitioning is currently unsupported in PostgreSQL, returning an error makes sense.
My reason for the warning on foreign tables is: that mainly to inform users that the behavior is unchanged (data copied), they just need to correct their commands.
When COPY FREEZE for partitioned tables becomes supported, we’ll need to ensure that none of the partitions are foreign tables.
If we find any, the FREEZE operation won’t be applicable. However, that's a consideration for the future.
LGTM.
--
Zhang Mingli
HashData
I understand your perspective, and I'm okay with it.
Since partitioning is currently unsupported in PostgreSQL, returning an error makes sense.
My reason for the warning on foreign tables is: that mainly to inform users that the behavior is unchanged (data copied), they just need to correct their commands.
When COPY FREEZE for partitioned tables becomes supported, we’ll need to ensure that none of the partitions are foreign tables.
If we find any, the FREEZE operation won’t be applicable. However, that's a consideration for the future.
LGTM.
--
Zhang Mingli
HashData