CrossPart Help

Xin chào!

Cộng đồng này dành cho các chuyên gia và những người đam mê các sản phẩm và dịch vụ của chúng tôi.
Chia sẻ và thảo luận về nội dung tốt nhất và ý tưởng tiếp thị mới, xây dựng hồ sơ chuyên nghiệp của bạn và trở thành một nhà tiếp thị tốt hơn cùng nhau.

0

ERROR: cannot truncate a table referenced in a foreign key constraint

Ảnh đại diện
GiMiTEC
gimitec=# TRUNCATE mail_message;
ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "mail_channel_partner" references "mail_message".
HINT:  Truncate table "mail_channel_partner" at the same time, or use TRUNCATE ... CASCADE.
2 Bình luận
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
GiMiTEC
-

on production systems when work time to time the table "mail_message" will become bigger and bigger. One day you need to truncate this table on PostgreSQL to help saving their life to continued system working.

1 Trả lời
0
Ảnh đại diện
GiMiTEC
Câu trả lời hay nhất

Just run:

> root@dna:~# su postgres

> postgres@dna:/root$ psql
could not change directory to "/root": Permission denied
psql (14.18 (Ubuntu 14.18-1.pgdg24.04+1))
Type "help" for help.


> postgres=# \c base
You are now connected to database "base" as user "postgres".
base=# TRUNCATE TABLE mail_message CASCADE;

and the log will look like:

NOTICE:  truncate cascades to table "mail_channel_partner"
NOTICE:  truncate cascades to table "mail_compose_message"
NOTICE:  truncate cascades to table "mail_mail"
NOTICE:  truncate cascades to table "mail_message_mail_channel_rel"
NOTICE:  truncate cascades to table "mail_message_res_partner_needaction_rel"
NOTICE:  truncate cascades to table "mail_message_res_partner_rel"
NOTICE:  truncate cascades to table "mail_message_res_partner_starred_rel"
NOTICE:  truncate cascades to table "mail_resend_message"
NOTICE:  truncate cascades to table "mail_tracking_value"
NOTICE:  truncate cascades to table "message_attachment_rel"
NOTICE:  truncate cascades to table "rating_rating"
NOTICE:  truncate cascades to table "sms_resend"
NOTICE:  truncate cascades to table "sms_sms"
NOTICE:  truncate cascades to table "snailmail_letter"
NOTICE:  truncate cascades to table "snailmail_letter_format_error"
NOTICE:  truncate cascades to table "account_invoice_send"
NOTICE:  truncate cascades to table "account_tour_upload_bill"
NOTICE:  truncate cascades to table "mail_compose_message_ir_attachments_object_rel"
NOTICE:  truncate cascades to table "mail_compose_message_ir_attachments_rel"
NOTICE:  truncate cascades to table "mail_compose_message_mailing_list_rel"
NOTICE:  truncate cascades to table "mail_compose_message_res_partner_rel"
NOTICE:  truncate cascades to table "mail_mail_res_partner_rel"
NOTICE:  truncate cascades to table "mail_message_res_partner_needaction_rel_mail_resend_message_rel"
NOTICE:  truncate cascades to table "mail_resend_partner"
NOTICE:  truncate cascades to table "mailing_trace"
NOTICE:  truncate cascades to table "sms_resend_recipient"
NOTICE:  truncate cascades to table "snailmail_letter_missing_required_fields"
NOTICE:  truncate cascades to table "account_move_account_invoice_send_rel"
NOTICE:  truncate cascades to table "link_tracker_click"
NOTICE:  truncate cascades to table "snailmail_confirm_invoice"
TRUNCATE TABLE


Ảnh đại diện
Huỷ bỏ
Buy GiMiTEC a Coffee

If you feel happiness with these code just buy us a coffee by 

GiMiTEC provide system administrator service mini jobs to help you solve your VPS or server as fast as you need with low cost as you can willing to pay.

What we provide by our work under remote or on side as list but no limit to these job:

  • Install and configuration Open Source business app: SuiteCRM, Dolibarr CRM/ERP, Erpnext, Flectra, Odoo, Idempiere.

  • Build new open source email server base on Postfix and Dovecot, with customized domains and email anti-spam best practice.

  • Build new LAMP stack base on Virtualmin to host mini lightweight company website and email and some small app suitable for SME business with low IT resource.

  • Upgrade your Idempiere ERP to new version.

  • Design .odt office template (such as quotation or sale contract, and so more) for your Odoo or Flectra system at version 11 to 13.

  • Upgrade  or install your ERPNEXT version.

  • Rebuild new VPS server base on https://contabo.com/en/ and install what software you need, transfer full control to you.

  • Contract to managed you VPS time to time for upgrade, backup and secure best practice

  • ....

Just drop some words on chat or contact to talk more detailing with our team



Legal Notice

Trademarks of Other Manufactures mentioned herein are the property of their (Other Manufactures). or their respective owners.

GiMiTEC.com™ is not affiliated with or licensed by any of these companies. All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.

Other trademarks and trade names may be used in this document to refer to either the entities claiming the marks and/or names or their products and are the property of their respective owners. We disclaims proprietary interest in the marks and names of others.

GiMiTEC.com™ and other GiMiTEC™ brand name mentioned herein are the property of the Gimium™ Ecosystem.


Your Dynamic Snippet will be displayed here... This message is displayed because you did not provided both a filter and a template to use.

   Gimium™ Ecosystem


GiMiTEC.com™

ONE SUPPLY CHAIN. INFINITE SOLUTIONS

CHRATEC.com™

'FOR WHAT WE NEED TO BE SURE'