acq.cancel_reason

Deferrable Constraints: The following FK constraints are deferrable — they are checked at transaction end, not statement end: cancel_reason_org_unit_fkey.

Columns

Column Type Nullable Default Notes

id PK

integer

No

nextval('acq.cancel_reason_id_seq'::regclass)

org_unit FK

integer

No

actor.org_unit(id)

label

text

No

description

text

No

keep_debits

boolean

No

false

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

org_unit

actor.org_unit(id)

NO ACTION

NO ACTION

DEFERRED

cancel_reason_org_unit_fkey

Unique Constraints

  • acq_cancel_reason_one_per_org_unit: (org_unit, label)

Indexes

Index Method Definition

cancel_reason_pkey PK

btree

CREATE UNIQUE INDEX cancel_reason_pkey ON acq.cancel_reason USING btree (id)

acq_cancel_reason_one_per_org_unit UNIQUE

btree

CREATE UNIQUE INDEX acq_cancel_reason_one_per_org_unit ON acq.cancel_reason USING btree (org_unit, label)

Triggers

Trigger Timing Event Level Function

acq_no_deleted_reserved_cancel_reasons

BEFORE

DELETE

ROW

evergreen.protect_reserved_rows_from_delete()

Trigger Bodies

acq_no_deleted_reserved_cancel_reasons

Function: evergreen.protect_reserved_rows_from_delete()
Timing: BEFORE DELETE ROW

BEGIN
IF OLD.id < TG_ARGV[0]::INT THEN
    RAISE EXCEPTION 'Cannot delete row with reserved ID %', OLD.id;
END IF;
RETURN OLD;
END

Referenced By

The following tables have foreign keys pointing to acq.cancel_reason (4 referencing table(s)):

Table Referencing Column(s) Referenced Column(s) Constraint

acq.lineitem

cancel_reason

id

lineitem_cancel_reason_fkey

acq.lineitem_detail

cancel_reason

id

lineitem_detail_cancel_reason_fkey

acq.purchase_order

cancel_reason

id

purchase_order_cancel_reason_fkey

acq.user_request

cancel_reason

id

user_request_cancel_reason_fkey