action.survey_response

Data-Modifying Triggers: This table has BEFORE ROW trigger(s) that modify row data before write. Values you INSERT or UPDATE may differ from what is actually stored. See the Triggers section below.

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

Columns

Column Type Nullable Default Notes

id PK

bigint

No

nextval('action.survey_response_id_seq'::regclass)

response_group_id

integer

Yes

usr

integer

Yes

survey FK

integer

No

action.survey(id)

question FK

integer

No

action.survey_question(id)

answer FK

integer

No

action.survey_answer(id)

answer_date

timestamp with time zone

Yes

effective_date

timestamp with time zone

No

now()

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

answer

action.survey_answer(id)

NO ACTION

NO ACTION

DEFERRED

survey_response_answer_fkey

question

action.survey_question(id)

NO ACTION

NO ACTION

DEFERRED

survey_response_question_fkey

survey

action.survey(id)

NO ACTION

NO ACTION

DEFERRED

survey_response_survey_fkey

Indexes

Index Method Definition

survey_response_pkey PK

btree

CREATE UNIQUE INDEX survey_response_pkey ON action.survey_response USING btree (id)

action_survey_response_usr_idx

btree

CREATE INDEX action_survey_response_usr_idx ON action.survey_response USING btree (usr)

Triggers

Trigger Timing Event Level Function

action_survey_response_answer_date_fixup_tgr

BEFORE

INSERT

ROW

action.survey_response_answer_date_fixup()

Trigger Bodies

action_survey_response_answer_date_fixup_tgr

Function: action.survey_response_answer_date_fixup()
Timing: BEFORE INSERT ROW

This trigger modifies the row before it is written (returns a modified NEW).

BEGIN
	NEW.answer_date := NOW();
	RETURN NEW;
END;