On 12/7/20 3:40 PM, Tom Lane wrote:
Ron writes:
That works *sometimes*, but not when we *really* want it to work.
test=# begin transaction;
BEGIN
test=# ALTER TABLE sales_header DETACH PARTITION sales_header_202001;
ERROR: removing partition "sales_header_202001" violates foreign key
constrain
Ron writes:
> That works *sometimes*, but not when we *really* want it to work.
> test=# begin transaction;
> BEGIN
> test=# ALTER TABLE sales_header DETACH PARTITION sales_header_202001;
> ERROR: removing partition "sales_header_202001" violates foreign key
> constraint "sales_detail_cust_id_o
On 12/7/20 1:27 PM, Tom Lane wrote:
Ron writes:
Neither technique worked.
test=# ALTER TABLE sales_detail ALTER CONSTRAINT
fk_sales_detail_sales_header DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE
Hmm, reproduced here. There seems to be some kind of bug
in ALTER CONSTRAINT --- it looks like it'
On 12/7/20 1:15 PM, Ron wrote:
On 12/7/20 1:27 PM, Tom Lane wrote:
Ron writes:
Neither technique worked.
test=# ALTER TABLE sales_detail ALTER CONSTRAINT
fk_sales_detail_sales_header DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE
Hmm, reproduced here. There seems to be some kind of bug
in ALTER
On 12/7/20 1:27 PM, Tom Lane wrote:
Ron writes:
Neither technique worked.
test=# ALTER TABLE sales_detail ALTER CONSTRAINT
fk_sales_detail_sales_header DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE
Hmm, reproduced here. There seems to be some kind of bug
in ALTER CONSTRAINT ---
Do I need to fi
Ron writes:
> Neither technique worked.
> test=# ALTER TABLE sales_detail ALTER CONSTRAINT
> fk_sales_detail_sales_header DEFERRABLE INITIALLY DEFERRED;
> ALTER TABLE
Hmm, reproduced here. There seems to be some kind of bug
in ALTER CONSTRAINT --- it looks like it's updated all the
child FKs s
On 12/7/20 12:19 PM, Thomas Kellerer wrote:
Ron schrieb am 07.12.2020 um 19:15:
Referenced by:
TABLE "sales_detail" CONSTRAINT "fk_sales_detail_sales_header"
FOREIGN KEY (cust_id, order_ts) REFERENCES
sales_header(cust_id, order_ts) *DEFERRABLE*
I think if you only mention "de
On 12/7/20 12:19 PM, Thomas Kellerer wrote:
Ron schrieb am 07.12.2020 um 19:15:
Referenced by:
TABLE "sales_detail" CONSTRAINT "fk_sales_detail_sales_header"
FOREIGN KEY (cust_id, order_ts) REFERENCES
sales_header(cust_id, order_ts) *DEFERRABLE*
I think if you only mention "de
Ron schrieb am 07.12.2020 um 19:15:
Referenced by:
TABLE "sales_detail" CONSTRAINT "fk_sales_detail_sales_header"
FOREIGN KEY (cust_id, order_ts) REFERENCES sales_header(cust_id,
order_ts) *DEFERRABLE*
I think if you only mention "deferrable" this is the same as "deferrable ini
v12.5
I added a deferrable FK constraint on sales_detail to ensure that no one can
delete records from sales_header when an associated sales_detail record
exists. That works perfectly.
The problem is that try to delete parent records before the child records
*inside a transaction* also fail
10 matches
Mail list logo