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 |
|
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: |
|
Trigger Side Effects: Writing to this table automatically triggers writes to other tables:
|
Columns
| Column | Type | Nullable | Default | Notes |
|---|---|---|---|---|
id PK |
|
No |
nextval('actor.usr_id_seq'::regclass) |
|
card |
|
Yes |
||
profile FK |
|
No |
||
usrname |
|
No |
||
|
Yes |
|||
passwd |
|
Yes |
||
standing FK |
|
No |
1 |
|
ident_type FK |
|
No |
||
ident_value |
|
Yes |
||
ident_type2 FK |
|
Yes |
||
ident_value2 |
|
Yes |
||
net_access_level FK |
|
No |
1 |
|
photo_url |
|
Yes |
||
prefix |
|
Yes |
||
first_given_name |
|
No |
||
second_given_name |
|
Yes |
||
family_name |
|
No |
||
suffix |
|
Yes |
||
guardian |
|
Yes |
||
pref_prefix |
|
Yes |
||
pref_first_given_name |
|
Yes |
||
pref_second_given_name |
|
Yes |
||
pref_family_name |
|
Yes |
||
pref_suffix |
|
Yes |
||
name_keywords |
|
Yes |
||
name_kw_tsvector |
|
Yes |
||
alias |
|
Yes |
||
day_phone |
|
Yes |
||
evening_phone |
|
Yes |
||
other_phone |
|
Yes |
||
mailing_address FK |
|
Yes |
||
billing_address FK |
|
Yes |
||
home_ou FK |
|
No |
||
dob |
|
Yes |
||
active |
|
No |
true |
|
master_account |
|
No |
false |
|
super_user |
|
No |
false |
|
barred |
|
No |
false |
|
deleted SOFT-DEL |
|
No |
false |
|
juvenile |
|
No |
false |
|
usrgroup |
|
No |
nextval('actor.usr_usrgroup_seq'::regclass) |
|
claims_returned_count |
|
No |
0 |
|
credit_forward_balance |
|
No |
0.00 |
|
last_xact_id |
|
No |
'none'::text |
|
create_date |
|
No |
now() |
|
expire_date |
|
No |
(now() + '3 years'::interval) |
|
claims_never_checked_out_count |
|
No |
0 |
|
last_update_time |
|
Yes |
||
locale FK |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
BEFORE |
INSERT |
ROW |
|
|
BEFORE |
UPDATE |
ROW |
|
|
BEFORE |
INSERT OR UPDATE |
ROW |
|
|
AFTER |
DELETE OR UPDATE |
ROW |
|
|
BEFORE |
INSERT OR UPDATE |
ROW |
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 |
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 |
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 |
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 |
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 |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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