actor.usr

User objects

This table contains the core User objects that describe both staff members and patrons. The difference between the two types of users is based on the user’s permissions.

Hub Table: This table is referenced by 125 foreign keys across the database. It is a central structural table — changes to rows here have wide-reaching effects. Consider all dependent schemas before deleting or modifying rows.

Soft Deletes: This table uses a deleted boolean flag rather than physical row deletion. Ad-hoc queries must include WHERE deleted = false to exclude logically-deleted rows. The application layer enforces this automatically; direct SQL does not.

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: actor_usr_billing_address_fkey, actor_usr_home_ou_fkey, actor_usr_mailing_address_fkey, actor_usr_profile_fkey, usr_ident_type2_fkey, usr_ident_type_fkey, usr_locale_fkey, usr_net_access_level_fkey, usr_standing_fkey.

Trigger Side Effects: Writing to this table automatically triggers writes to other tables:

Columns

Column Type Nullable Default Notes

id PK

integer

No

nextval('actor.usr_id_seq'::regclass)

card

integer

Yes

profile FK

integer

No

permission.grp_tree(id)

usrname

text

No

email

text

Yes

passwd

text

Yes

standing FK

integer

No

1

config.standing(id)

ident_type FK

integer

No

config.identification_type(id)

ident_value

text

Yes

ident_type2 FK

integer

Yes

config.identification_type(id)

ident_value2

text

Yes

net_access_level FK

integer

No

1

config.net_access_level(id)

photo_url

text

Yes

prefix

text

Yes

first_given_name

text

No

second_given_name

text

Yes

family_name

text

No

suffix

text

Yes

guardian

text

Yes

pref_prefix

text

Yes

pref_first_given_name

text

Yes

pref_second_given_name

text

Yes

pref_family_name

text

Yes

pref_suffix

text

Yes

name_keywords

text

Yes

name_kw_tsvector

tsvector

Yes

alias

text

Yes

day_phone

text

Yes

evening_phone

text

Yes

other_phone

text

Yes

mailing_address FK

integer

Yes

actor.usr_address(id)

billing_address FK

integer

Yes

actor.usr_address(id)

home_ou FK

integer

No

actor.org_unit(id)

dob

date

Yes

active

boolean

No

true

master_account

boolean

No

false

super_user

boolean

No

false

barred

boolean

No

false

deleted SOFT-DEL

boolean

No

false

juvenile

boolean

No

false

usrgroup

integer

No

nextval('actor.usr_usrgroup_seq'::regclass)

claims_returned_count

integer

No

0

credit_forward_balance

numeric(6,2)

No

0.00

last_xact_id

text

No

'none'::text

create_date

timestamp with time zone

No

now()

expire_date

timestamp with time zone

No

(now() + '3 years'::interval)

claims_never_checked_out_count

integer

No

0

last_update_time

timestamp with time zone

Yes

locale FK

text

Yes

config.i18n_locale(code)

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

billing_address

actor.usr_address(id)

NO ACTION

NO ACTION

DEFERRED

actor_usr_billing_address_fkey

home_ou

actor.org_unit(id)

NO ACTION

NO ACTION

DEFERRED

actor_usr_home_ou_fkey

mailing_address

actor.usr_address(id)

NO ACTION

NO ACTION

DEFERRED

actor_usr_mailing_address_fkey

profile

permission.grp_tree(id)

NO ACTION

NO ACTION

DEFERRED

actor_usr_profile_fkey

ident_type2

config.identification_type(id)

NO ACTION

NO ACTION

DEFERRED

usr_ident_type2_fkey

ident_type

config.identification_type(id)

NO ACTION

NO ACTION

DEFERRED

usr_ident_type_fkey

locale

config.i18n_locale(code)

NO ACTION

NO ACTION

DEFERRED

usr_locale_fkey

net_access_level

config.net_access_level(id)

NO ACTION

NO ACTION

DEFERRED

usr_net_access_level_fkey

standing

config.standing(id)

NO ACTION

NO ACTION

DEFERRED

usr_standing_fkey

Unique Constraints

  • usr_card_key: (card)

  • usr_usrname_key: (usrname)

Indexes

Index Method Definition

usr_pkey PK

btree

CREATE UNIQUE INDEX usr_pkey ON actor.usr USING btree (id)

usr_card_key UNIQUE

btree

CREATE UNIQUE INDEX usr_card_key ON actor.usr USING btree (card)

usr_usrname_key UNIQUE

btree

CREATE UNIQUE INDEX usr_usrname_key ON actor.usr USING btree (usrname)

actor_usr_billing_address_idx

btree

CREATE INDEX actor_usr_billing_address_idx ON actor.usr USING btree (billing_address)

actor_usr_day_phone_idx

btree

CREATE INDEX actor_usr_day_phone_idx ON actor.usr USING btree (lowercase(day_phone))

actor_usr_day_phone_idx_numeric

btree

CREATE INDEX actor_usr_day_phone_idx_numeric ON actor.usr USING btree (lowercase(regexp_replace(day_phone, '[^0-9]'::text, ''::text, 'g'::text)))

actor_usr_email_idx

btree

CREATE INDEX actor_usr_email_idx ON actor.usr USING btree (lowercase(email))

actor_usr_evening_phone_idx

btree

CREATE INDEX actor_usr_evening_phone_idx ON actor.usr USING btree (lowercase(evening_phone))

actor_usr_evening_phone_idx_numeric

btree

CREATE INDEX actor_usr_evening_phone_idx_numeric ON actor.usr USING btree (lowercase(regexp_replace(evening_phone, '[^0-9]'::text, ''::text, 'g'::text)))

actor_usr_family_name_idx

btree

CREATE INDEX actor_usr_family_name_idx ON actor.usr USING btree (lowercase(family_name))

actor_usr_family_name_unaccent_idx

btree

CREATE INDEX actor_usr_family_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(family_name))

actor_usr_first_given_name_idx

btree

CREATE INDEX actor_usr_first_given_name_idx ON actor.usr USING btree (lowercase(first_given_name))

actor_usr_first_given_name_unaccent_idx

btree

CREATE INDEX actor_usr_first_given_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(first_given_name))

actor_usr_guardian_idx

btree

CREATE INDEX actor_usr_guardian_idx ON actor.usr USING btree (lowercase(guardian))

actor_usr_guardian_unaccent_idx

btree

CREATE INDEX actor_usr_guardian_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(guardian))

actor_usr_home_ou_idx

btree

CREATE INDEX actor_usr_home_ou_idx ON actor.usr USING btree (home_ou)

actor_usr_ident_value2_idx

btree

CREATE INDEX actor_usr_ident_value2_idx ON actor.usr USING btree (lowercase(ident_value2))

actor_usr_ident_value_idx

btree

CREATE INDEX actor_usr_ident_value_idx ON actor.usr USING btree (lowercase(ident_value))

actor_usr_mailing_address_idx

btree

CREATE INDEX actor_usr_mailing_address_idx ON actor.usr USING btree (mailing_address)

actor_usr_other_phone_idx

btree

CREATE INDEX actor_usr_other_phone_idx ON actor.usr USING btree (lowercase(other_phone))

actor_usr_other_phone_idx_numeric

btree

CREATE INDEX actor_usr_other_phone_idx_numeric ON actor.usr USING btree (lowercase(regexp_replace(other_phone, '[^0-9]'::text, ''::text, 'g'::text)))

actor_usr_pref_family_name_idx

btree

CREATE INDEX actor_usr_pref_family_name_idx ON actor.usr USING btree (lowercase(pref_family_name))

actor_usr_pref_family_name_unaccent_idx

btree

CREATE INDEX actor_usr_pref_family_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(pref_family_name))

actor_usr_pref_first_given_name_idx

btree

CREATE INDEX actor_usr_pref_first_given_name_idx ON actor.usr USING btree (lowercase(pref_first_given_name))

actor_usr_pref_first_given_name_unaccent_idx

btree

CREATE INDEX actor_usr_pref_first_given_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(pref_first_given_name))

actor_usr_pref_second_given_name_idx

btree

CREATE INDEX actor_usr_pref_second_given_name_idx ON actor.usr USING btree (lowercase(pref_second_given_name))

actor_usr_pref_second_given_name_unaccent_idx

btree

CREATE INDEX actor_usr_pref_second_given_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(pref_second_given_name))

actor_usr_second_given_name_idx

btree

CREATE INDEX actor_usr_second_given_name_idx ON actor.usr USING btree (lowercase(second_given_name))

actor_usr_second_given_name_unaccent_idx

btree

CREATE INDEX actor_usr_second_given_name_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(second_given_name))

actor_usr_usrgroup_idx

btree

CREATE INDEX actor_usr_usrgroup_idx ON actor.usr USING btree (usrgroup)

actor_usr_usrname_idx

btree

CREATE INDEX actor_usr_usrname_idx ON actor.usr USING btree (lowercase(usrname))

actor_usr_usrname_unaccent_idx

btree

CREATE INDEX actor_usr_usrname_unaccent_idx ON actor.usr USING btree (unaccent_and_squash(usrname))

Triggers

Trigger Timing Event Level Function

actor_crypt_pw_insert_trigger

BEFORE

INSERT

ROW

actor.crypt_pw_insert()

actor_crypt_pw_update_trigger

BEFORE

UPDATE

ROW

actor.crypt_pw_update()

au_update_trig

BEFORE

INSERT OR UPDATE

ROW

actor.au_updated()

audit_actor_usr_update_trigger

AFTER

DELETE OR UPDATE

ROW

auditor.audit_actor_usr_func()

user_ingest_name_keywords_tgr

BEFORE

INSERT OR UPDATE

ROW

actor.user_ingest_name_keywords()

Trigger Bodies

actor_crypt_pw_insert_trigger

Function: actor.crypt_pw_insert()
Timing: BEFORE INSERT ROW

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

	BEGIN
		NEW.passwd = MD5( NEW.passwd );
		RETURN NEW;
	END;

actor_crypt_pw_update_trigger

Function: actor.crypt_pw_update()
Timing: BEFORE UPDATE ROW

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

	BEGIN
		IF NEW.passwd <> OLD.passwd THEN
			NEW.passwd = MD5( NEW.passwd );
		END IF;
		RETURN NEW;
	END;

au_update_trig

Function: actor.au_updated()
Timing: BEFORE INSERT OR UPDATE ROW

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

BEGIN
    NEW.last_update_time := now();
	RETURN NEW;
END;

audit_actor_usr_update_trigger

Function: auditor.audit_actor_usr_func()
Timing: AFTER DELETE OR UPDATE ROW

        BEGIN
            INSERT INTO auditor.actor_usr_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, card, profile, usrname, email, passwd, standing, ident_type, ident_value, ident_type2, ident_value2, net_access_level, photo_url, prefix, first_given_name, second_given_name, family_name, suffix, guardian, pref_prefix, pref_first_given_name, pref_second_given_name, pref_family_name, pref_suffix, name_keywords, name_kw_tsvector, alias, day_phone, evening_phone, other_phone, mailing_address, billing_address, home_ou, dob, active, master_account, super_user, barred, deleted, juvenile, usrgroup, claims_returned_count, credit_forward_balance, last_xact_id, create_date, expire_date, claims_never_checked_out_count, last_update_time, locale )
                SELECT  nextval('auditor.actor_usr_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.card, OLD.profile, OLD.usrname, OLD.email, OLD.passwd, OLD.standing, OLD.ident_type, OLD.ident_value, OLD.ident_type2, OLD.ident_value2, OLD.net_access_level, OLD.photo_url, OLD.prefix, OLD.first_given_name, OLD.second_given_name, OLD.family_name, OLD.suffix, OLD.guardian, OLD.pref_prefix, OLD.pref_first_given_name, OLD.pref_second_given_name, OLD.pref_family_name, OLD.pref_suffix, OLD.name_keywords, OLD.name_kw_tsvector, OLD.alias, OLD.day_phone, OLD.evening_phone, OLD.other_phone, OLD.mailing_address, OLD.billing_address, OLD.home_ou, OLD.dob, OLD.active, OLD.master_account, OLD.super_user, OLD.barred, OLD.deleted, OLD.juvenile, OLD.usrgroup, OLD.claims_returned_count, OLD.credit_forward_balance, OLD.last_xact_id, OLD.create_date, OLD.expire_date, OLD.claims_never_checked_out_count, OLD.last_update_time, OLD.locale
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;

user_ingest_name_keywords_tgr

Function: actor.user_ingest_name_keywords()
Timing: BEFORE INSERT OR UPDATE ROW

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

BEGIN
    NEW.name_kw_tsvector := TO_TSVECTOR(
        COALESCE(NEW.prefix, '')                || ' ' ||
        COALESCE(NEW.first_given_name, '')      || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.first_given_name), '') || ' ' ||
        COALESCE(NEW.second_given_name, '')     || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.second_given_name), '') || ' ' ||
        COALESCE(NEW.family_name, '')           || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.family_name), '') || ' ' ||
        COALESCE(NEW.suffix, '')                || ' ' ||
        COALESCE(NEW.pref_prefix, '')            || ' ' ||
        COALESCE(NEW.pref_first_given_name, '')  || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.pref_first_given_name), '') || ' ' ||
        COALESCE(NEW.pref_second_given_name, '') || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.pref_second_given_name), '') || ' ' ||
        COALESCE(NEW.pref_family_name, '')       || ' ' ||
        COALESCE(evergreen.unaccent_and_squash(NEW.pref_family_name), '') || ' ' ||
        COALESCE(NEW.pref_suffix, '')            || ' ' ||
        COALESCE(NEW.name_keywords, '')
    );
    RETURN NEW;
END;

Referenced By

The following tables have foreign keys pointing to actor.usr (125 referencing table(s)):

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

acq.claim_event

creator

id

claim_event_creator_fkey

acq.distribution_formula_application

creator

id

distribution_formula_application_creator_fkey

acq.fund_allocation

allocator

id

fund_allocation_allocator_fkey

acq.fund_allocation_percent

allocator

id

fund_allocation_percent_allocator_fkey

acq.fund_transfer

transfer_user

id

fund_transfer_transfer_user_fkey

acq.invoice

closed_by

id

invoice_closed_by_fkey

acq.lineitem

creator

id

lineitem_creator_fkey

acq.lineitem

editor

id

lineitem_editor_fkey

acq.lineitem

selector

id

lineitem_selector_fkey

acq.lineitem_detail

receiver

id

lineitem_detail_receiver_fkey

acq.lineitem_note

creator

id

lineitem_note_creator_fkey

acq.lineitem_note

editor

id

lineitem_note_editor_fkey

acq.lineitem_usr_attr_definition

usr

id

lineitem_usr_attr_definition_usr_fkey

acq.picklist

creator

id

picklist_creator_fkey

acq.picklist

editor

id

picklist_editor_fkey

acq.picklist

owner

id

picklist_owner_fkey

acq.po_note

creator

id

po_note_creator_fkey

acq.po_note

editor

id

po_note_editor_fkey

acq.provider_note

creator

id

provider_note_creator_fkey

acq.provider_note

editor

id

provider_note_editor_fkey

acq.purchase_order

creator

id

purchase_order_creator_fkey

acq.purchase_order

editor

id

purchase_order_editor_fkey

acq.purchase_order

owner

id

purchase_order_owner_fkey

acq.serial_claim_event

creator

id

serial_claim_event_creator_fkey

acq.shipment_notification

processed_by

id

shipment_notification_processed_by_fkey

acq.user_request

usr

id

user_request_usr_fkey

action.batch_hold_event

staff

id

batch_hold_event_staff_fkey

action.circulation

usr

id

action_circulation_usr_fkey

action.curbside

delivery_staff

id

curbside_delivery_staff_fkey

action.curbside

patron

id

curbside_patron_fkey

action.curbside

stage_staff

id

curbside_stage_staff_fkey

action.emergency_closing

creator

id

emergency_closing_creator_fkey

action.fieldset

owner

id

fieldset_owner_fkey

action.fieldset_group

creator

id

fieldset_group_creator_fkey

action.hold_notification

notify_staff

id

hold_notification_notify_staff_fkey

action.hold_request

canceled_by

id

hold_request_canceled_by_fkey

action.hold_request

fulfillment_staff

id

hold_request_fulfillment_staff_fkey

action.hold_request

requestor

id

hold_request_requestor_fkey

action.hold_request

usr

id

hold_request_usr_fkey

action.hold_request_reset_reason_entry

requestor

id

hold_request_reset_reason_entry_requestor_fkey

action.in_house_use

staff

id

in_house_use_staff_fkey

action.ingest_queue

who

id

ingest_queue_who_fkey

action.non_cat_in_house_use

staff

id

non_cat_in_house_use_staff_fkey

action.non_cataloged_circulation

patron

id

non_cataloged_circulation_patron_fkey

action.non_cataloged_circulation

staff

id

non_cataloged_circulation_staff_fkey

action.usr_circ_history

usr

id

usr_circ_history_usr_fkey

action_trigger.event

context_user

id

event_context_user_fkey

actor.card

usr

id

card_usr_fkey

actor.passwd

usr

id

passwd_usr_fkey

actor.stat_cat_entry_usr_map

target_usr

id

actor_sceum_tu_fkey

actor.toolbar

usr

id

toolbar_usr_fkey

actor.usr_activity

usr

id

usr_activity_usr_fkey

actor.usr_address

usr

id

usr_address_usr_fkey

actor.usr_message

editor

id

usr_message_editor_fkey

actor.usr_message

usr

id

usr_message_usr_fkey

actor.usr_mfa_exception

usr

id

usr_mfa_exception_usr_fkey

actor.usr_mfa_factor_map

usr

id

usr_mfa_factor_map_usr_fkey

actor.usr_org_unit_opt_in

staff

id

usr_org_unit_opt_in_staff_fkey

actor.usr_org_unit_opt_in

usr

id

usr_org_unit_opt_in_usr_fkey

actor.usr_password_reset

usr

id

usr_password_reset_usr_fkey

actor.usr_privacy_waiver

usr

id

usr_privacy_waiver_usr_fkey

actor.usr_saved_search

owner

id

usr_saved_search_owner_fkey

actor.usr_setting

usr

id

usr_setting_usr_fkey

actor.usr_standing_penalty

staff

id

usr_standing_penalty_staff_fkey

actor.usr_standing_penalty

usr

id

usr_standing_penalty_usr_fkey

asset.call_number

creator

id

asset_call_number_creator_fkey

asset.call_number

editor

id

asset_call_number_editor_fkey

asset.call_number_note

creator

id

asset_call_number_note_creator_fkey

asset.copy

creator

id

asset_copy_creator_fkey

asset.copy

editor

id

asset_copy_editor_fkey

asset.copy_alert

ack_staff

id

copy_alert_ack_staff_fkey

asset.copy_alert

create_staff

id

copy_alert_create_staff_fkey

asset.copy_note

creator

id

asset_copy_note_creator_fkey

asset.copy_template

creator

id

copy_template_creator_fkey

asset.copy_template

editor

id

copy_template_editor_fkey

asset.course_module_course_users

usr

id

course_module_course_users_usr_fkey

biblio.record_entry

creator

id

biblio_record_entry_creator_fkey

biblio.record_entry

editor

id

biblio_record_entry_editor_fkey

biblio.record_note

creator

id

biblio_record_note_creator_fkey

biblio.record_note

editor

id

biblio_record_note_editor_fkey

booking.reservation

capture_staff

id

reservation_capture_staff_fkey

booking.reservation

usr

id

booking_reservation_usr_fkey

config.filter_dialog_filter_set

creator

id

config_filter_dialog_filter_set_creator_fkey

container.biblio_record_entry_bucket

owner

id

biblio_record_entry_bucket_owner_fkey

container.biblio_record_entry_bucket_usr_flags

usr

id

biblio_record_entry_bucket_usr_flags_usr_fkey

container.call_number_bucket

owner

id

call_number_bucket_owner_fkey

container.carousel

creator

id

carousel_creator_fkey

container.carousel

editor

id

carousel_editor_fkey

container.copy_bucket

owner

id

copy_bucket_owner_fkey

container.user_bucket

owner

id

user_bucket_owner_fkey

container.user_bucket_item

target_user

id

user_bucket_item_target_user_fkey

money.billable_xact

usr

id

money_billable_xact_usr_fkey

money.collections_tracker

collector

id

collections_tracker_collector_fkey

money.collections_tracker

usr

id

collections_tracker_usr_fkey

openapi.endpoint_access_attempt_log

accessor

id

endpoint_access_attempt_log_accessor_fkey

openapi.endpoint_set_user_rate_limit_map

accessor

id

endpoint_set_user_rate_limit_map_accessor_fkey

openapi.endpoint_user_rate_limit_map

accessor

id

endpoint_user_rate_limit_map_accessor_fkey

openapi.integrator

id

id

integrator_id_fkey

permission.usr_grp_map

usr

id

usr_grp_map_usr_fkey

permission.usr_object_perm_map

usr

id

usr_object_perm_map_usr_fkey

permission.usr_perm_map

usr

id

usr_perm_map_usr_fkey

permission.usr_work_ou_map

usr

id

usr_work_ou_map_usr_fkey

reporter.output_folder

owner

id

output_folder_owner_fkey

reporter.report

owner

id

report_owner_fkey

reporter.report_folder

owner

id

report_folder_owner_fkey

reporter.schedule

runner

id

schedule_runner_fkey

reporter.template

owner

id

template_owner_fkey

reporter.template_folder

owner

id

template_folder_owner_fkey

serial.distribution_note

creator

id

distribution_note_creator_fkey

serial.issuance

creator

id

issuance_creator_fkey

serial.issuance

editor

id

issuance_editor_fkey

serial.item

creator

id

item_creator_fkey

serial.item

editor

id

item_editor_fkey

serial.item_note

creator

id

item_note_creator_fkey

serial.routing_list_user

reader

id

routing_list_user_reader_fkey

serial.subscription_note

creator

id

subscription_note_creator_fkey

serial.unit

creator

id

serial_unit_creator_fkey

serial.unit

editor

id

serial_unit_editor_fkey

sip.account

usr

id

account_usr_fkey

staging.user_stage

requesting_usr

id

user_stage_requesting_usr_fkey

url_verify.session

creator

id

session_creator_fkey

url_verify.verification_attempt

usr

id

verification_attempt_usr_fkey

vandelay.background_import

owner

id

background_import_owner_fkey

vandelay.queue

owner

id

queue_owner_fkey

vandelay.session_tracker

usr

id

session_tracker_usr_fkey