<?xml version="1.0" encoding="UTF-8"?><database name="egdb3_13_6" schema="auditor" type="PostgreSQL - 15.10 (Ubuntu 15.10-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="acq_fund_debit_pkey_seq" startValue="1"/>
      <sequence increment="1" name="acq_invoice_entry_pkey_seq" startValue="1"/>
      <sequence increment="1" name="acq_invoice_item_pkey_seq" startValue="1"/>
      <sequence increment="1" name="acq_invoice_pkey_seq" startValue="1"/>
      <sequence increment="1" name="actor_org_unit_pkey_seq" startValue="1"/>
      <sequence increment="1" name="actor_usr_address_pkey_seq" startValue="1"/>
      <sequence increment="1" name="actor_usr_pkey_seq" startValue="1"/>
      <sequence increment="1" name="asset_call_number_pkey_seq" startValue="1"/>
      <sequence increment="1" name="asset_copy_pkey_seq" startValue="1"/>
      <sequence increment="1" name="biblio_record_entry_pkey_seq" startValue="1"/>
      <sequence increment="1" name="serial_unit_pkey_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="acq_fund_debit_history" numRows="57" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="fund" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="origin_amount" nullable="false" remarks="" size="0" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="origin_currency_type" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="amount" nullable="false" remarks="" size="0" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="encumbrance" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="debit_type" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="xfer_destination" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="13" name="create_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="invoice_entry" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="acq_fund_debit_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
      </table>
      <table name="acq_fund_debit_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    fund_debit.id,&#10;    fund_debit.fund,&#10;    fund_debit.origin_amount,&#10;    fund_debit.origin_currency_type,&#10;    fund_debit.amount,&#10;    fund_debit.encumbrance,&#10;    fund_debit.debit_type,&#10;    fund_debit.xfer_destination,&#10;    fund_debit.create_time,&#10;    fund_debit.invoice_entry&#10;   FROM acq.fund_debit&#10;UNION ALL&#10; SELECT acq_fund_debit_history.audit_id,&#10;    acq_fund_debit_history.audit_time,&#10;    acq_fund_debit_history.audit_action,&#10;    acq_fund_debit_history.audit_user,&#10;    acq_fund_debit_history.audit_ws,&#10;    acq_fund_debit_history.id,&#10;    acq_fund_debit_history.fund,&#10;    acq_fund_debit_history.origin_amount,&#10;    acq_fund_debit_history.origin_currency_type,&#10;    acq_fund_debit_history.amount,&#10;    acq_fund_debit_history.encumbrance,&#10;    acq_fund_debit_history.debit_type,&#10;    acq_fund_debit_history.xfer_destination,&#10;    acq_fund_debit_history.create_time,&#10;    acq_fund_debit_history.invoice_entry&#10;   FROM auditor.acq_fund_debit_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="fund" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="origin_amount" nullable="true" remarks="" size="0" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="origin_currency_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="amount" nullable="true" remarks="" size="0" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="encumbrance" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="debit_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="xfer_destination" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="13" name="create_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="invoice_entry" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
      </table>
      <table name="acq_invoice_entry_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="invoice" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="purchase_order" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="lineitem" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="inv_item_count" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="phys_item_count" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="billed_per_item" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="cost_billed" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="actual_cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="15" name="amount_paid" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="acq_invoice_entry_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
      </table>
      <table name="acq_invoice_entry_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    invoice_entry.id,&#10;    invoice_entry.invoice,&#10;    invoice_entry.purchase_order,&#10;    invoice_entry.lineitem,&#10;    invoice_entry.inv_item_count,&#10;    invoice_entry.phys_item_count,&#10;    invoice_entry.note,&#10;    invoice_entry.billed_per_item,&#10;    invoice_entry.cost_billed,&#10;    invoice_entry.actual_cost,&#10;    invoice_entry.amount_paid&#10;   FROM acq.invoice_entry&#10;UNION ALL&#10; SELECT acq_invoice_entry_history.audit_id,&#10;    acq_invoice_entry_history.audit_time,&#10;    acq_invoice_entry_history.audit_action,&#10;    acq_invoice_entry_history.audit_user,&#10;    acq_invoice_entry_history.audit_ws,&#10;    acq_invoice_entry_history.id,&#10;    acq_invoice_entry_history.invoice,&#10;    acq_invoice_entry_history.purchase_order,&#10;    acq_invoice_entry_history.lineitem,&#10;    acq_invoice_entry_history.inv_item_count,&#10;    acq_invoice_entry_history.phys_item_count,&#10;    acq_invoice_entry_history.note,&#10;    acq_invoice_entry_history.billed_per_item,&#10;    acq_invoice_entry_history.cost_billed,&#10;    acq_invoice_entry_history.actual_cost,&#10;    acq_invoice_entry_history.amount_paid&#10;   FROM auditor.acq_invoice_entry_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="invoice" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="purchase_order" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="lineitem" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="inv_item_count" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="phys_item_count" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="billed_per_item" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="cost_billed" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="actual_cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="15" name="amount_paid" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
      </table>
      <table name="acq_invoice_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="receiver" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="provider" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="shipper" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="recv_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="recv_method" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="inv_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="inv_ident" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="payment_auth" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="payment_method" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="16" name="close_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="closed_by" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="acq_invoice_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
      </table>
      <table name="acq_invoice_item_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="invoice" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="purchase_order" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="fund_debit" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="inv_item_type" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="cost_billed" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="actual_cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="fund" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="16" name="amount_paid" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="po_item" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="target" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="acq_invoice_item_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
      </table>
      <table name="acq_invoice_item_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    invoice_item.id,&#10;    invoice_item.invoice,&#10;    invoice_item.purchase_order,&#10;    invoice_item.fund_debit,&#10;    invoice_item.inv_item_type,&#10;    invoice_item.title,&#10;    invoice_item.author,&#10;    invoice_item.note,&#10;    invoice_item.cost_billed,&#10;    invoice_item.actual_cost,&#10;    invoice_item.fund,&#10;    invoice_item.amount_paid,&#10;    invoice_item.po_item,&#10;    invoice_item.target&#10;   FROM acq.invoice_item&#10;UNION ALL&#10; SELECT acq_invoice_item_history.audit_id,&#10;    acq_invoice_item_history.audit_time,&#10;    acq_invoice_item_history.audit_action,&#10;    acq_invoice_item_history.audit_user,&#10;    acq_invoice_item_history.audit_ws,&#10;    acq_invoice_item_history.id,&#10;    acq_invoice_item_history.invoice,&#10;    acq_invoice_item_history.purchase_order,&#10;    acq_invoice_item_history.fund_debit,&#10;    acq_invoice_item_history.inv_item_type,&#10;    acq_invoice_item_history.title,&#10;    acq_invoice_item_history.author,&#10;    acq_invoice_item_history.note,&#10;    acq_invoice_item_history.cost_billed,&#10;    acq_invoice_item_history.actual_cost,&#10;    acq_invoice_item_history.fund,&#10;    acq_invoice_item_history.amount_paid,&#10;    acq_invoice_item_history.po_item,&#10;    acq_invoice_item_history.target&#10;   FROM auditor.acq_invoice_item_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="invoice" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="purchase_order" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="fund_debit" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="inv_item_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="cost_billed" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="actual_cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="fund" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="16" name="amount_paid" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="po_item" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="target" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
      </table>
      <table name="acq_invoice_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    invoice.id,&#10;    invoice.receiver,&#10;    invoice.provider,&#10;    invoice.shipper,&#10;    invoice.recv_date,&#10;    invoice.recv_method,&#10;    invoice.inv_type,&#10;    invoice.inv_ident,&#10;    invoice.payment_auth,&#10;    invoice.payment_method,&#10;    invoice.note,&#10;    invoice.close_date,&#10;    invoice.closed_by&#10;   FROM acq.invoice&#10;UNION ALL&#10; SELECT acq_invoice_history.audit_id,&#10;    acq_invoice_history.audit_time,&#10;    acq_invoice_history.audit_action,&#10;    acq_invoice_history.audit_user,&#10;    acq_invoice_history.audit_ws,&#10;    acq_invoice_history.id,&#10;    acq_invoice_history.receiver,&#10;    acq_invoice_history.provider,&#10;    acq_invoice_history.shipper,&#10;    acq_invoice_history.recv_date,&#10;    acq_invoice_history.recv_method,&#10;    acq_invoice_history.inv_type,&#10;    acq_invoice_history.inv_ident,&#10;    acq_invoice_history.payment_auth,&#10;    acq_invoice_history.payment_method,&#10;    acq_invoice_history.note,&#10;    acq_invoice_history.close_date,&#10;    acq_invoice_history.closed_by&#10;   FROM auditor.acq_invoice_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="receiver" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="provider" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="shipper" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="recv_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="recv_method" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="inv_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="inv_ident" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="payment_auth" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="payment_method" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="16" name="close_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="closed_by" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
      </table>
      <table name="actor_org_unit_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="parent_ou" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="ou_type" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="ill_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="holds_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="mailing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="billing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="shortname" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="email" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="opac_visible" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="fiscal_calendar" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="actor_org_unit_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
      </table>
      <table name="actor_org_unit_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    org_unit.id,&#10;    org_unit.parent_ou,&#10;    org_unit.ou_type,&#10;    org_unit.ill_address,&#10;    org_unit.holds_address,&#10;    org_unit.mailing_address,&#10;    org_unit.billing_address,&#10;    org_unit.shortname,&#10;    org_unit.name,&#10;    org_unit.email,&#10;    org_unit.phone,&#10;    org_unit.opac_visible,&#10;    org_unit.fiscal_calendar&#10;   FROM actor.org_unit&#10;UNION ALL&#10; SELECT actor_org_unit_history.audit_id,&#10;    actor_org_unit_history.audit_time,&#10;    actor_org_unit_history.audit_action,&#10;    actor_org_unit_history.audit_user,&#10;    actor_org_unit_history.audit_ws,&#10;    actor_org_unit_history.id,&#10;    actor_org_unit_history.parent_ou,&#10;    actor_org_unit_history.ou_type,&#10;    actor_org_unit_history.ill_address,&#10;    actor_org_unit_history.holds_address,&#10;    actor_org_unit_history.mailing_address,&#10;    actor_org_unit_history.billing_address,&#10;    actor_org_unit_history.shortname,&#10;    actor_org_unit_history.name,&#10;    actor_org_unit_history.email,&#10;    actor_org_unit_history.phone,&#10;    actor_org_unit_history.opac_visible,&#10;    actor_org_unit_history.fiscal_calendar&#10;   FROM auditor.actor_org_unit_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="parent_ou" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="ou_type" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="ill_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="holds_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="mailing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="billing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="shortname" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="email" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="opac_visible" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="fiscal_calendar" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
      </table>
      <table name="actor_usr_address_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="valid" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="within_city_limits" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="address_type" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="usr" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="street1" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="street2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="city" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="county" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="state" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="country" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="post_code" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="pending" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="replaces" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="actor_usr_address_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_actor_usr_address_hist_id_idx" unique="false">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="actor_usr_address_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    usr_address.id,&#10;    usr_address.valid,&#10;    usr_address.within_city_limits,&#10;    usr_address.address_type,&#10;    usr_address.usr,&#10;    usr_address.street1,&#10;    usr_address.street2,&#10;    usr_address.city,&#10;    usr_address.county,&#10;    usr_address.state,&#10;    usr_address.country,&#10;    usr_address.post_code,&#10;    usr_address.pending,&#10;    usr_address.replaces&#10;   FROM actor.usr_address&#10;UNION ALL&#10; SELECT actor_usr_address_history.audit_id,&#10;    actor_usr_address_history.audit_time,&#10;    actor_usr_address_history.audit_action,&#10;    actor_usr_address_history.audit_user,&#10;    actor_usr_address_history.audit_ws,&#10;    actor_usr_address_history.id,&#10;    actor_usr_address_history.valid,&#10;    actor_usr_address_history.within_city_limits,&#10;    actor_usr_address_history.address_type,&#10;    actor_usr_address_history.usr,&#10;    actor_usr_address_history.street1,&#10;    actor_usr_address_history.street2,&#10;    actor_usr_address_history.city,&#10;    actor_usr_address_history.county,&#10;    actor_usr_address_history.state,&#10;    actor_usr_address_history.country,&#10;    actor_usr_address_history.post_code,&#10;    actor_usr_address_history.pending,&#10;    actor_usr_address_history.replaces&#10;   FROM auditor.actor_usr_address_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="valid" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="within_city_limits" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="address_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="usr" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="street1" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="street2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="city" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="county" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="state" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="country" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="post_code" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="pending" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="replaces" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
      </table>
      <table name="actor_usr_history" numRows="760" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="card" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="profile" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="usrname" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="email" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="passwd" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="standing" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="ident_type" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="ident_value" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="ident_type2" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="ident_value2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="net_access_level" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="photo_url" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="prefix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="first_given_name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="second_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="family_name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="suffix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="guardian" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="pref_prefix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="pref_first_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="pref_second_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="pref_family_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="pref_suffix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="name_keywords" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="name_kw_tsvector" nullable="true" remarks="" size="2147483647" type="tsvector" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="alias" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="day_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="evening_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="34" name="other_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="35" name="mailing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="billing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="37" name="home_ou" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="38" name="dob" nullable="true" remarks="" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="39" name="active" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="40" name="master_account" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="41" name="super_user" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="42" name="barred" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="43" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="44" name="juvenile" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="45" name="usrgroup" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="46" name="claims_returned_count" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="47" name="credit_forward_balance" nullable="false" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="48" name="last_xact_id" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="49" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="50" name="expire_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="51" name="claims_never_checked_out_count" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="52" name="last_update_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="53" name="locale" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="actor_usr_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_actor_usr_hist_id_idx" unique="false">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="actor_usr_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    usr.id,&#10;    usr.card,&#10;    usr.profile,&#10;    usr.usrname,&#10;    usr.email,&#10;    usr.passwd,&#10;    usr.standing,&#10;    usr.ident_type,&#10;    usr.ident_value,&#10;    usr.ident_type2,&#10;    usr.ident_value2,&#10;    usr.net_access_level,&#10;    usr.photo_url,&#10;    usr.prefix,&#10;    usr.first_given_name,&#10;    usr.second_given_name,&#10;    usr.family_name,&#10;    usr.suffix,&#10;    usr.guardian,&#10;    usr.pref_prefix,&#10;    usr.pref_first_given_name,&#10;    usr.pref_second_given_name,&#10;    usr.pref_family_name,&#10;    usr.pref_suffix,&#10;    usr.name_keywords,&#10;    usr.name_kw_tsvector,&#10;    usr.alias,&#10;    usr.day_phone,&#10;    usr.evening_phone,&#10;    usr.other_phone,&#10;    usr.mailing_address,&#10;    usr.billing_address,&#10;    usr.home_ou,&#10;    usr.dob,&#10;    usr.active,&#10;    usr.master_account,&#10;    usr.super_user,&#10;    usr.barred,&#10;    usr.deleted,&#10;    usr.juvenile,&#10;    usr.usrgroup,&#10;    usr.claims_returned_count,&#10;    usr.credit_forward_balance,&#10;    usr.last_xact_id,&#10;    usr.create_date,&#10;    usr.expire_date,&#10;    usr.claims_never_checked_out_count,&#10;    usr.last_update_time,&#10;    usr.locale&#10;   FROM actor.usr&#10;UNION ALL&#10; SELECT actor_usr_history.audit_id,&#10;    actor_usr_history.audit_time,&#10;    actor_usr_history.audit_action,&#10;    actor_usr_history.audit_user,&#10;    actor_usr_history.audit_ws,&#10;    actor_usr_history.id,&#10;    actor_usr_history.card,&#10;    actor_usr_history.profile,&#10;    actor_usr_history.usrname,&#10;    actor_usr_history.email,&#10;    actor_usr_history.passwd,&#10;    actor_usr_history.standing,&#10;    actor_usr_history.ident_type,&#10;    actor_usr_history.ident_value,&#10;    actor_usr_history.ident_type2,&#10;    actor_usr_history.ident_value2,&#10;    actor_usr_history.net_access_level,&#10;    actor_usr_history.photo_url,&#10;    actor_usr_history.prefix,&#10;    actor_usr_history.first_given_name,&#10;    actor_usr_history.second_given_name,&#10;    actor_usr_history.family_name,&#10;    actor_usr_history.suffix,&#10;    actor_usr_history.guardian,&#10;    actor_usr_history.pref_prefix,&#10;    actor_usr_history.pref_first_given_name,&#10;    actor_usr_history.pref_second_given_name,&#10;    actor_usr_history.pref_family_name,&#10;    actor_usr_history.pref_suffix,&#10;    actor_usr_history.name_keywords,&#10;    actor_usr_history.name_kw_tsvector,&#10;    actor_usr_history.alias,&#10;    actor_usr_history.day_phone,&#10;    actor_usr_history.evening_phone,&#10;    actor_usr_history.other_phone,&#10;    actor_usr_history.mailing_address,&#10;    actor_usr_history.billing_address,&#10;    actor_usr_history.home_ou,&#10;    actor_usr_history.dob,&#10;    actor_usr_history.active,&#10;    actor_usr_history.master_account,&#10;    actor_usr_history.super_user,&#10;    actor_usr_history.barred,&#10;    actor_usr_history.deleted,&#10;    actor_usr_history.juvenile,&#10;    actor_usr_history.usrgroup,&#10;    actor_usr_history.claims_returned_count,&#10;    actor_usr_history.credit_forward_balance,&#10;    actor_usr_history.last_xact_id,&#10;    actor_usr_history.create_date,&#10;    actor_usr_history.expire_date,&#10;    actor_usr_history.claims_never_checked_out_count,&#10;    actor_usr_history.last_update_time,&#10;    actor_usr_history.locale&#10;   FROM auditor.actor_usr_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="card" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="profile" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="usrname" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="email" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="passwd" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="standing" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="ident_type" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="ident_value" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="ident_type2" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="ident_value2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="net_access_level" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="photo_url" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="prefix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="first_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="second_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="family_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="suffix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="guardian" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="pref_prefix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="pref_first_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="pref_second_given_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="pref_family_name" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="pref_suffix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="name_keywords" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="name_kw_tsvector" nullable="true" remarks="" size="2147483647" type="tsvector" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="alias" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="day_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="evening_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="34" name="other_phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="35" name="mailing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="billing_address" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="37" name="home_ou" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="38" name="dob" nullable="true" remarks="" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="39" name="active" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="40" name="master_account" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="41" name="super_user" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="42" name="barred" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="43" name="deleted" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="44" name="juvenile" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="45" name="usrgroup" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="46" name="claims_returned_count" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="47" name="credit_forward_balance" nullable="true" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="48" name="last_xact_id" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="49" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="50" name="expire_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="51" name="claims_never_checked_out_count" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="52" name="last_update_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="53" name="locale" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
      </table>
      <table name="asset_call_number_history" numRows="1821" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="creator" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="editor" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="record" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="owning_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="label" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="prefix" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="suffix" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="label_class" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="label_sortkey" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="asset_call_number_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_asset_cn_hist_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="aud_asset_cn_hist_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
      </table>
      <table name="asset_call_number_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    call_number.id,&#10;    call_number.creator,&#10;    call_number.create_date,&#10;    call_number.editor,&#10;    call_number.edit_date,&#10;    call_number.record,&#10;    call_number.owning_lib,&#10;    call_number.label,&#10;    call_number.deleted,&#10;    call_number.prefix,&#10;    call_number.suffix,&#10;    call_number.label_class,&#10;    call_number.label_sortkey&#10;   FROM asset.call_number&#10;UNION ALL&#10; SELECT asset_call_number_history.audit_id,&#10;    asset_call_number_history.audit_time,&#10;    asset_call_number_history.audit_action,&#10;    asset_call_number_history.audit_user,&#10;    asset_call_number_history.audit_ws,&#10;    asset_call_number_history.id,&#10;    asset_call_number_history.creator,&#10;    asset_call_number_history.create_date,&#10;    asset_call_number_history.editor,&#10;    asset_call_number_history.edit_date,&#10;    asset_call_number_history.record,&#10;    asset_call_number_history.owning_lib,&#10;    asset_call_number_history.label,&#10;    asset_call_number_history.deleted,&#10;    asset_call_number_history.prefix,&#10;    asset_call_number_history.suffix,&#10;    asset_call_number_history.label_class,&#10;    asset_call_number_history.label_sortkey&#10;   FROM auditor.asset_call_number_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="creator" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="editor" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="record" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="owning_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="label" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="deleted" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="prefix" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="suffix" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="label_class" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="label_sortkey" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
      </table>
      <table name="asset_copy_history" numRows="19355" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="circ_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="creator" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="call_number" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="editor" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="copy_number" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="location" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="loan_duration" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="fine_level" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="age_protect" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="circulate" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="deposit" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="ref" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="holdable" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="22" name="deposit_amount" nullable="false" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="23" name="price" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="barcode" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="circ_modifier" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="circ_as_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="dummy_title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="dummy_author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="alert_message" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="opac_visible" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="floating" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="dummy_isbn" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="34" name="status_changed_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="35" name="active_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="mint_condition" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="37" name="cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="asset_copy_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_asset_cp_hist_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="aud_asset_cp_hist_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
      </table>
      <table name="asset_copy_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    copy.id,&#10;    copy.circ_lib,&#10;    copy.creator,&#10;    copy.call_number,&#10;    copy.editor,&#10;    copy.create_date,&#10;    copy.edit_date,&#10;    copy.copy_number,&#10;    copy.status,&#10;    copy.location,&#10;    copy.loan_duration,&#10;    copy.fine_level,&#10;    copy.age_protect,&#10;    copy.circulate,&#10;    copy.deposit,&#10;    copy.ref,&#10;    copy.holdable,&#10;    copy.deposit_amount,&#10;    copy.price,&#10;    copy.barcode,&#10;    copy.circ_modifier,&#10;    copy.circ_as_type,&#10;    copy.dummy_title,&#10;    copy.dummy_author,&#10;    copy.alert_message,&#10;    copy.opac_visible,&#10;    copy.deleted,&#10;    copy.floating,&#10;    copy.dummy_isbn,&#10;    copy.status_changed_time,&#10;    copy.active_date,&#10;    copy.mint_condition,&#10;    copy.cost&#10;   FROM asset.copy&#10;UNION ALL&#10; SELECT asset_copy_history.audit_id,&#10;    asset_copy_history.audit_time,&#10;    asset_copy_history.audit_action,&#10;    asset_copy_history.audit_user,&#10;    asset_copy_history.audit_ws,&#10;    asset_copy_history.id,&#10;    asset_copy_history.circ_lib,&#10;    asset_copy_history.creator,&#10;    asset_copy_history.call_number,&#10;    asset_copy_history.editor,&#10;    asset_copy_history.create_date,&#10;    asset_copy_history.edit_date,&#10;    asset_copy_history.copy_number,&#10;    asset_copy_history.status,&#10;    asset_copy_history.location,&#10;    asset_copy_history.loan_duration,&#10;    asset_copy_history.fine_level,&#10;    asset_copy_history.age_protect,&#10;    asset_copy_history.circulate,&#10;    asset_copy_history.deposit,&#10;    asset_copy_history.ref,&#10;    asset_copy_history.holdable,&#10;    asset_copy_history.deposit_amount,&#10;    asset_copy_history.price,&#10;    asset_copy_history.barcode,&#10;    asset_copy_history.circ_modifier,&#10;    asset_copy_history.circ_as_type,&#10;    asset_copy_history.dummy_title,&#10;    asset_copy_history.dummy_author,&#10;    asset_copy_history.alert_message,&#10;    asset_copy_history.opac_visible,&#10;    asset_copy_history.deleted,&#10;    asset_copy_history.floating,&#10;    asset_copy_history.dummy_isbn,&#10;    asset_copy_history.status_changed_time,&#10;    asset_copy_history.active_date,&#10;    asset_copy_history.mint_condition,&#10;    asset_copy_history.cost&#10;   FROM auditor.asset_copy_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="circ_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="creator" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="call_number" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="editor" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="copy_number" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="location" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="loan_duration" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="fine_level" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="age_protect" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="circulate" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="deposit" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="ref" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="holdable" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="22" name="deposit_amount" nullable="true" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="23" name="price" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="barcode" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="circ_modifier" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="circ_as_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="dummy_title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="dummy_author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="alert_message" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="opac_visible" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="deleted" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="floating" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="dummy_isbn" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="34" name="status_changed_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="35" name="active_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="mint_condition" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="37" name="cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
      </table>
      <table name="biblio_record_entry_history" numRows="688" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="editor" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="source" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="quality" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="active" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="fingerprint" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="tcn_source" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="tcn_value" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="marc" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="last_xact_id" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="vis_attr_vector" nullable="true" remarks="" size="10" type="_int4" typeCode="2003"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="owner" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="share_depth" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="22" name="merge_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="merged_to" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="biblio_record_entry_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_bib_rec_entry_hist_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="aud_bib_rec_entry_hist_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
      </table>
      <table name="biblio_record_entry_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    record_entry.id,&#10;    record_entry.creator,&#10;    record_entry.editor,&#10;    record_entry.source,&#10;    record_entry.quality,&#10;    record_entry.create_date,&#10;    record_entry.edit_date,&#10;    record_entry.active,&#10;    record_entry.deleted,&#10;    record_entry.fingerprint,&#10;    record_entry.tcn_source,&#10;    record_entry.tcn_value,&#10;    record_entry.marc,&#10;    record_entry.last_xact_id,&#10;    record_entry.vis_attr_vector,&#10;    record_entry.owner,&#10;    record_entry.share_depth,&#10;    record_entry.merge_date,&#10;    record_entry.merged_to&#10;   FROM biblio.record_entry&#10;UNION ALL&#10; SELECT biblio_record_entry_history.audit_id,&#10;    biblio_record_entry_history.audit_time,&#10;    biblio_record_entry_history.audit_action,&#10;    biblio_record_entry_history.audit_user,&#10;    biblio_record_entry_history.audit_ws,&#10;    biblio_record_entry_history.id,&#10;    biblio_record_entry_history.creator,&#10;    biblio_record_entry_history.editor,&#10;    biblio_record_entry_history.source,&#10;    biblio_record_entry_history.quality,&#10;    biblio_record_entry_history.create_date,&#10;    biblio_record_entry_history.edit_date,&#10;    biblio_record_entry_history.active,&#10;    biblio_record_entry_history.deleted,&#10;    biblio_record_entry_history.fingerprint,&#10;    biblio_record_entry_history.tcn_source,&#10;    biblio_record_entry_history.tcn_value,&#10;    biblio_record_entry_history.marc,&#10;    biblio_record_entry_history.last_xact_id,&#10;    biblio_record_entry_history.vis_attr_vector,&#10;    biblio_record_entry_history.owner,&#10;    biblio_record_entry_history.share_depth,&#10;    biblio_record_entry_history.merge_date,&#10;    biblio_record_entry_history.merged_to&#10;   FROM auditor.biblio_record_entry_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="creator" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="editor" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="source" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="quality" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="active" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="deleted" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="fingerprint" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="tcn_source" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="tcn_value" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="marc" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="last_xact_id" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="vis_attr_vector" nullable="true" remarks="" size="10" type="_int4" typeCode="2003"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="owner" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="share_depth" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="22" name="merge_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="merged_to" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
      </table>
      <table name="serial_unit_history" remarks="" schema="auditor" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="circ_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="creator" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="call_number" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="editor" nullable="false" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="copy_number" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="location" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="loan_duration" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="fine_level" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="age_protect" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="circulate" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="deposit" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="ref" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="holdable" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="22" name="deposit_amount" nullable="false" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="23" name="price" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="barcode" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="circ_modifier" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="circ_as_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="dummy_title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="dummy_author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="alert_message" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="opac_visible" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="floating" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="dummy_isbn" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="34" name="status_changed_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="35" name="active_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="mint_condition" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="37" name="cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="38" name="sort_key" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="39" name="detailed_contents" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="40" name="summary_contents" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="audit_id" sequenceNumberInPK="1"/>
         <index name="serial_unit_history_pkey" unique="true">
            <column ascending="true" name="audit_id"/>
         </index>
         <index name="aud_serial_unit_hist_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="aud_serial_unit_hist_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
      </table>
      <table name="serial_unit_lifecycle" numRows="0" remarks="" schema="auditor" type="VIEW" viewSql=" SELECT '-1'::integer AS audit_id,&#10;    now() AS audit_time,&#10;    '-'::text AS audit_action,&#10;    '-1'::integer AS audit_user,&#10;    '-1'::integer AS audit_ws,&#10;    unit.id,&#10;    unit.circ_lib,&#10;    unit.creator,&#10;    unit.call_number,&#10;    unit.editor,&#10;    unit.create_date,&#10;    unit.edit_date,&#10;    unit.copy_number,&#10;    unit.status,&#10;    unit.location,&#10;    unit.loan_duration,&#10;    unit.fine_level,&#10;    unit.age_protect,&#10;    unit.circulate,&#10;    unit.deposit,&#10;    unit.ref,&#10;    unit.holdable,&#10;    unit.deposit_amount,&#10;    unit.price,&#10;    unit.barcode,&#10;    unit.circ_modifier,&#10;    unit.circ_as_type,&#10;    unit.dummy_title,&#10;    unit.dummy_author,&#10;    unit.alert_message,&#10;    unit.opac_visible,&#10;    unit.deleted,&#10;    unit.floating,&#10;    unit.dummy_isbn,&#10;    unit.status_changed_time,&#10;    unit.active_date,&#10;    unit.mint_condition,&#10;    unit.cost,&#10;    unit.sort_key,&#10;    unit.detailed_contents,&#10;    unit.summary_contents&#10;   FROM serial.unit&#10;UNION ALL&#10; SELECT serial_unit_history.audit_id,&#10;    serial_unit_history.audit_time,&#10;    serial_unit_history.audit_action,&#10;    serial_unit_history.audit_user,&#10;    serial_unit_history.audit_ws,&#10;    serial_unit_history.id,&#10;    serial_unit_history.circ_lib,&#10;    serial_unit_history.creator,&#10;    serial_unit_history.call_number,&#10;    serial_unit_history.editor,&#10;    serial_unit_history.create_date,&#10;    serial_unit_history.edit_date,&#10;    serial_unit_history.copy_number,&#10;    serial_unit_history.status,&#10;    serial_unit_history.location,&#10;    serial_unit_history.loan_duration,&#10;    serial_unit_history.fine_level,&#10;    serial_unit_history.age_protect,&#10;    serial_unit_history.circulate,&#10;    serial_unit_history.deposit,&#10;    serial_unit_history.ref,&#10;    serial_unit_history.holdable,&#10;    serial_unit_history.deposit_amount,&#10;    serial_unit_history.price,&#10;    serial_unit_history.barcode,&#10;    serial_unit_history.circ_modifier,&#10;    serial_unit_history.circ_as_type,&#10;    serial_unit_history.dummy_title,&#10;    serial_unit_history.dummy_author,&#10;    serial_unit_history.alert_message,&#10;    serial_unit_history.opac_visible,&#10;    serial_unit_history.deleted,&#10;    serial_unit_history.floating,&#10;    serial_unit_history.dummy_isbn,&#10;    serial_unit_history.status_changed_time,&#10;    serial_unit_history.active_date,&#10;    serial_unit_history.mint_condition,&#10;    serial_unit_history.cost,&#10;    serial_unit_history.sort_key,&#10;    serial_unit_history.detailed_contents,&#10;    serial_unit_history.summary_contents&#10;   FROM auditor.serial_unit_history;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="audit_id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="audit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="audit_action" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="audit_user" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="audit_ws" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="circ_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="creator" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="call_number" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="editor" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="11" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="copy_number" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="location" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="loan_duration" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="fine_level" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="age_protect" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="circulate" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="deposit" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="ref" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="holdable" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="22" name="deposit_amount" nullable="true" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="23" name="price" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="barcode" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="circ_modifier" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="circ_as_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="dummy_title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="dummy_author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="alert_message" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="opac_visible" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="deleted" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="floating" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="dummy_isbn" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="34" name="status_changed_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="35" name="active_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="36" name="mint_condition" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="37" name="cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="38" name="sort_key" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="39" name="detailed_contents" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="40" name="summary_contents" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
      </table>
   </tables>
   <routines>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_acq_fund_debit_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.acq_fund_debit_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, fund, origin_amount, origin_currency_type, amount, encumbrance, debit_type, xfer_destination, create_time, invoice_entry )
                SELECT  nextval('auditor.acq_fund_debit_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.fund, OLD.origin_amount, OLD.origin_currency_type, OLD.amount, OLD.encumbrance, OLD.debit_type, OLD.xfer_destination, OLD.create_time, OLD.invoice_entry
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_acq_invoice_entry_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.acq_invoice_entry_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, invoice, purchase_order, lineitem, inv_item_count, phys_item_count, note, billed_per_item, cost_billed, actual_cost, amount_paid )
                SELECT  nextval('auditor.acq_invoice_entry_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.invoice, OLD.purchase_order, OLD.lineitem, OLD.inv_item_count, OLD.phys_item_count, OLD.note, OLD.billed_per_item, OLD.cost_billed, OLD.actual_cost, OLD.amount_paid
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_acq_invoice_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.acq_invoice_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, receiver, provider, shipper, recv_date, recv_method, inv_type, inv_ident, payment_auth, payment_method, note, close_date, closed_by )
                SELECT  nextval('auditor.acq_invoice_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.receiver, OLD.provider, OLD.shipper, OLD.recv_date, OLD.recv_method, OLD.inv_type, OLD.inv_ident, OLD.payment_auth, OLD.payment_method, OLD.note, OLD.close_date, OLD.closed_by
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_acq_invoice_item_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.acq_invoice_item_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, invoice, purchase_order, fund_debit, inv_item_type, title, author, note, cost_billed, actual_cost, fund, amount_paid, po_item, target )
                SELECT  nextval('auditor.acq_invoice_item_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.invoice, OLD.purchase_order, OLD.fund_debit, OLD.inv_item_type, OLD.title, OLD.author, OLD.note, OLD.cost_billed, OLD.actual_cost, OLD.fund, OLD.amount_paid, OLD.po_item, OLD.target
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_actor_org_unit_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.actor_org_unit_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, parent_ou, ou_type, ill_address, holds_address, mailing_address, billing_address, shortname, name, email, phone, opac_visible, fiscal_calendar )
                SELECT  nextval('auditor.actor_org_unit_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.parent_ou, OLD.ou_type, OLD.ill_address, OLD.holds_address, OLD.mailing_address, OLD.billing_address, OLD.shortname, OLD.name, OLD.email, OLD.phone, OLD.opac_visible, OLD.fiscal_calendar
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_actor_usr_address_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.actor_usr_address_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, valid, within_city_limits, address_type, usr, street1, street2, city, county, state, country, post_code, pending, replaces )
                SELECT  nextval('auditor.actor_usr_address_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.valid, OLD.within_city_limits, OLD.address_type, OLD.usr, OLD.street1, OLD.street2, OLD.city, OLD.county, OLD.state, OLD.country, OLD.post_code, OLD.pending, OLD.replaces
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_actor_usr_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[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;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_asset_call_number_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.asset_call_number_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, creator, create_date, editor, edit_date, record, owning_lib, label, deleted, prefix, suffix, label_class, label_sortkey )
                SELECT  nextval('auditor.asset_call_number_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.creator, OLD.create_date, OLD.editor, OLD.edit_date, OLD.record, OLD.owning_lib, OLD.label, OLD.deleted, OLD.prefix, OLD.suffix, OLD.label_class, OLD.label_sortkey
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_asset_copy_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.asset_copy_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, circ_lib, creator, call_number, editor, create_date, edit_date, copy_number, status, location, loan_duration, fine_level, age_protect, circulate, deposit, ref, holdable, deposit_amount, price, barcode, circ_modifier, circ_as_type, dummy_title, dummy_author, alert_message, opac_visible, deleted, floating, dummy_isbn, status_changed_time, active_date, mint_condition, cost )
                SELECT  nextval('auditor.asset_copy_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.circ_lib, OLD.creator, OLD.call_number, OLD.editor, OLD.create_date, OLD.edit_date, OLD.copy_number, OLD.status, OLD.location, OLD.loan_duration, OLD.fine_level, OLD.age_protect, OLD.circulate, OLD.deposit, OLD.ref, OLD.holdable, OLD.deposit_amount, OLD.price, OLD.barcode, OLD.circ_modifier, OLD.circ_as_type, OLD.dummy_title, OLD.dummy_author, OLD.alert_message, OLD.opac_visible, OLD.deleted, OLD.floating, OLD.dummy_isbn, OLD.status_changed_time, OLD.active_date, OLD.mint_condition, OLD.cost
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_biblio_record_entry_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.biblio_record_entry_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, creator, editor, source, quality, create_date, edit_date, active, deleted, fingerprint, tcn_source, tcn_value, marc, last_xact_id, vis_attr_vector, owner, share_depth, merge_date, merged_to )
                SELECT  nextval('auditor.biblio_record_entry_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.creator, OLD.editor, OLD.source, OLD.quality, OLD.create_date, OLD.edit_date, OLD.active, OLD.deleted, OLD.fingerprint, OLD.tcn_source, OLD.tcn_value, OLD.marc, OLD.last_xact_id, OLD.vis_attr_vector, OLD.owner, OLD.share_depth, OLD.merge_date, OLD.merged_to
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="audit_serial_unit_func()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
            INSERT INTO auditor.serial_unit_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, circ_lib, creator, call_number, editor, create_date, edit_date, copy_number, status, location, loan_duration, fine_level, age_protect, circulate, deposit, ref, holdable, deposit_amount, price, barcode, circ_modifier, circ_as_type, dummy_title, dummy_author, alert_message, opac_visible, deleted, floating, dummy_isbn, status_changed_time, active_date, mint_condition, cost, sort_key, detailed_contents, summary_contents )
                SELECT  nextval('auditor.serial_unit_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.id, OLD.circ_lib, OLD.creator, OLD.call_number, OLD.editor, OLD.create_date, OLD.edit_date, OLD.copy_number, OLD.status, OLD.location, OLD.loan_duration, OLD.fine_level, OLD.age_protect, OLD.circulate, OLD.deposit, OLD.ref, OLD.holdable, OLD.deposit_amount, OLD.price, OLD.barcode, OLD.circ_modifier, OLD.circ_as_type, OLD.dummy_title, OLD.dummy_author, OLD.alert_message, OLD.opac_visible, OLD.deleted, OLD.floating, OLD.dummy_isbn, OLD.status_changed_time, OLD.active_date, OLD.mint_condition, OLD.cost, OLD.sort_key, OLD.detailed_contents, OLD.summary_contents
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="clear_audit_info()" returnType="void" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plperlu"><![CDATA[delete($_SHARED{"eg_audit_user"});
    delete($_SHARED{"eg_audit_ws"});]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
    PERFORM auditor.create_auditor_seq(sch, tbl);
    PERFORM auditor.create_auditor_history(sch, tbl);
    PERFORM auditor.create_auditor_func(sch, tbl);
    PERFORM auditor.create_auditor_update_trigger(sch, tbl);
    PERFORM auditor.create_auditor_lifecycle(sch, tbl);
    RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor_func(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[DECLARE
    column_list TEXT[];
BEGIN
    SELECT INTO column_list array_agg(a.attname)
        FROM pg_catalog.pg_attribute a
            JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
        WHERE relkind = 'r' AND n.nspname = sch AND c.relname = tbl AND a.attnum > 0 AND NOT a.attisdropped;

    EXECUTE $$
        CREATE OR REPLACE FUNCTION auditor.audit_$$ || sch || $$_$$ || tbl || $$_func ()
        RETURNS TRIGGER AS $func$
        BEGIN
            INSERT INTO auditor.$$ || sch || $$_$$ || tbl || $$_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, $$
            || array_to_string(column_list, ', ') || $$ )
                SELECT  nextval('auditor.$$ || sch || $$_$$ || tbl || $$_pkey_seq'),
                    now(),
                    SUBSTR(TG_OP,1,1),
                    eg_user,
                    eg_ws,
                    OLD.$$ || array_to_string(column_list, ', OLD.') || $$
                FROM auditor.get_audit_info();
            RETURN NULL;
        END;
        $func$ LANGUAGE 'plpgsql';
    $$;
    RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor_history(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
    EXECUTE $$
        CREATE TABLE auditor.$$ || sch || $$_$$ || tbl || $$_history (
            audit_id	BIGINT				PRIMARY KEY,
            audit_time	TIMESTAMP WITH TIME ZONE	NOT NULL,
            audit_action	TEXT				NOT NULL,
            audit_user  INT,
            audit_ws    INT,
            LIKE $$ || sch || $$.$$ || tbl || $$
        );
    $$;
	RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor_lifecycle(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[DECLARE
    column_list TEXT[];
BEGIN
    SELECT INTO column_list array_agg(a.attname)
        FROM pg_catalog.pg_attribute a
            JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
        WHERE relkind = 'r' AND n.nspname = sch AND c.relname = tbl AND a.attnum > 0 AND NOT a.attisdropped;

    EXECUTE $$
        CREATE VIEW auditor.$$ || sch || $$_$$ || tbl || $$_lifecycle AS
            SELECT -1 AS audit_id,
                   now() AS audit_time,
                   '-' AS audit_action,
                   -1 AS audit_user,
                   -1 AS audit_ws,
                   $$ || array_to_string(column_list, ', ') || $$
              FROM $$ || sch || $$.$$ || tbl || $$
                UNION ALL
            SELECT audit_id, audit_time, audit_action, audit_user, audit_ws,
            $$ || array_to_string(column_list, ', ') || $$
              FROM auditor.$$ || sch || $$_$$ || tbl || $$_history;
    $$;
    RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor_seq(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
    EXECUTE $$
        CREATE SEQUENCE auditor.$$ || sch || $$_$$ || tbl || $$_pkey_seq;
    $$;
	RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="create_auditor_update_trigger(sch text, tbl text)" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
    EXECUTE $$
        CREATE TRIGGER audit_$$ || sch || $$_$$ || tbl || $$_update_trigger
            AFTER UPDATE OR DELETE ON $$ || sch || $$.$$ || tbl || $$ FOR EACH ROW
            EXECUTE PROCEDURE auditor.audit_$$ || sch || $$_$$ || tbl || $$_func ();
    $$;
	RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="sch" type="text"/>
            <parameter mode="IN" name="tbl" type="text"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="fix_columns()" returnType="void" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[DECLARE
    current_table TEXT = ''; -- Storage for post-loop main table name
    current_audit_table TEXT = ''; -- Storage for post-loop audit table name
    query TEXT = ''; -- Storage for built query
    cr RECORD; -- column record object
    alter_t BOOL = false; -- Has the alter table command been appended yet
    auditor_cores TEXT[] = ARRAY[]::TEXT[]; -- Core auditor function list (filled inside of loop)
    core_column TEXT; -- The current core column we are adding
BEGIN
    FOR cr IN
        WITH audit_tables AS ( -- Basic grab of auditor tables. Anything in the auditor namespace, basically. With oids.
            SELECT c.oid AS audit_oid, c.relname AS audit_table
            FROM pg_catalog.pg_class c
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE relkind='r' AND nspname = 'auditor'
        ),
        table_set AS ( -- Union of auditor tables with their "main" tables. With oids.
            SELECT a.audit_oid, a.audit_table, c.oid AS main_oid, n.nspname as main_namespace, c.relname as main_table
            FROM pg_catalog.pg_class c
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            JOIN audit_tables a ON a.audit_table = n.nspname || '_' || c.relname || '_history'
            WHERE relkind = 'r'
        ),
        column_lists AS ( -- All columns associated with the auditor or main table, grouped by the main table's oid.
            SELECT DISTINCT ON (main_oid, attname) t.main_oid, a.attname
            FROM table_set t
            JOIN pg_catalog.pg_attribute a ON a.attrelid IN (t.main_oid, t.audit_oid)
            WHERE attnum > 0 AND NOT attisdropped
        ),
        column_defs AS ( -- The motherload, every audit table and main table plus column names and defs.
            SELECT audit_table,
                   main_namespace,
                   main_table,
                   a.attname AS main_column, -- These two will be null for columns that have since been deleted, or for auditor core columns
                   pg_catalog.format_type(a.atttypid, a.atttypmod) AS main_column_def,
                   b.attname AS audit_column, -- These two will be null for columns that have since been added
                   pg_catalog.format_type(b.atttypid, b.atttypmod) AS audit_column_def
            FROM table_set t
            JOIN column_lists c USING (main_oid)
            LEFT JOIN pg_catalog.pg_attribute a ON a.attname = c.attname AND a.attrelid = t.main_oid AND a.attnum > 0 AND NOT a.attisdropped
            LEFT JOIN pg_catalog.pg_attribute b ON b.attname = c.attname AND b.attrelid = t.audit_oid AND b.attnum > 0 AND NOT b.attisdropped
        )
        -- Nice sorted output from the above
        SELECT * FROM column_defs WHERE main_column_def IS DISTINCT FROM audit_column_def ORDER BY main_namespace, main_table, main_column, audit_column
    LOOP
        IF current_table <> (cr.main_namespace || '.' || cr.main_table) THEN -- New table?
            FOR core_column IN SELECT DISTINCT unnest(auditor_cores) LOOP -- Update missing core auditor columns
                IF NOT alter_t THEN -- Add ALTER TABLE if we haven't already
                    query:=query || $$ALTER TABLE auditor.$$ || current_audit_table;
                    alter_t:=TRUE;
                ELSE
                    query:=query || $$,$$;
                END IF;
                -- Bit of a sneaky bit here. Create audit_id as a bigserial so it gets automatic values and doesn't complain about nulls when becoming a PRIMARY KEY.
                query:=query || $$ ADD COLUMN $$ || CASE WHEN core_column = 'audit_id bigint' THEN $$audit_id bigserial PRIMARY KEY$$ ELSE core_column END;
            END LOOP;
            IF alter_t THEN -- Open alter table = needs a semicolon
                query:=query || $$; $$;
                alter_t:=FALSE;
                IF 'audit_id bigint' = ANY(auditor_cores) THEN -- We added a primary key...
                    -- Fun! Drop the default on audit_id, drop the auto-created sequence, create a new one, and set the current value
                    -- For added fun, we have to execute in chunks due to the parser checking setval/currval arguments at parse time.
                    EXECUTE query;
                    EXECUTE $$ALTER TABLE auditor.$$ || current_audit_table || $$ ALTER COLUMN audit_id DROP DEFAULT; $$ ||
                        $$CREATE SEQUENCE auditor.$$ || current_audit_table || $$_pkey_seq;$$;
                    EXECUTE $$SELECT setval('auditor.$$ || current_audit_table || $$_pkey_seq', currval('auditor.$$ || current_audit_table || $$_audit_id_seq')); $$ ||
                        $$DROP SEQUENCE auditor.$$ || current_audit_table || $$_audit_id_seq;$$;
                    query:='';
                END IF;
            END IF;
            -- New table means we reset the list of needed auditor core columns
            auditor_cores = ARRAY['audit_id bigint', 'audit_time timestamp with time zone', 'audit_action text', 'audit_user integer', 'audit_ws integer'];
            -- And store some values for use later, because we can't rely on cr in all places.
            current_table:=cr.main_namespace || '.' || cr.main_table;
            current_audit_table:=cr.audit_table;
        END IF;
        IF cr.main_column IS NULL AND cr.audit_column LIKE 'audit_%' THEN -- Core auditor column?
            -- Remove core from list of cores
            SELECT INTO auditor_cores array_agg(core) FROM unnest(auditor_cores) AS core WHERE core != (cr.audit_column || ' ' || cr.audit_column_def);
        ELSIF cr.main_column IS NULL THEN -- Main column doesn't exist, and it isn't an auditor column. Needs dropping from the auditor.
            IF NOT alter_t THEN
                query:=query || $$ALTER TABLE auditor.$$ || current_audit_table;
                alter_t:=TRUE;
            ELSE
                query:=query || $$,$$;
            END IF;
            query:=query || $$ DROP COLUMN $$ || cr.audit_column;
        ELSIF cr.audit_column IS NULL AND cr.main_column IS NOT NULL THEN -- New column auditor doesn't have. Add it.
            IF NOT alter_t THEN
                query:=query || $$ALTER TABLE auditor.$$ || current_audit_table;
                alter_t:=TRUE;
            ELSE
                query:=query || $$,$$;
            END IF;
            query:=query || $$ ADD COLUMN $$ || cr.main_column || $$ $$ || cr.main_column_def;
        ELSIF cr.main_column IS NOT NULL AND cr.audit_column IS NOT NULL THEN -- Both sides have this column, but types differ. Fix that.
            IF NOT alter_t THEN
                query:=query || $$ALTER TABLE auditor.$$ || current_audit_table;
                alter_t:=TRUE;
            ELSE
                query:=query || $$,$$;
            END IF;
            query:=query || $$ ALTER COLUMN $$ || cr.audit_column || $$ TYPE $$ || cr.main_column_def;
        END IF;
    END LOOP;
    FOR core_column IN SELECT DISTINCT unnest(auditor_cores) LOOP -- Repeat this outside of the loop to catch the last table
        IF NOT alter_t THEN
            query:=query || $$ALTER TABLE auditor.$$ || current_audit_table;
            alter_t:=TRUE;
        ELSE
            query:=query || $$,$$;
        END IF;
        -- Bit of a sneaky bit here. Create audit_id as a bigserial so it gets automatic values and doesn't complain about nulls when becoming a PRIMARY KEY.
        query:=query || $$ ADD COLUMN $$ || CASE WHEN core_column = 'audit_id bigint' THEN $$audit_id bigserial PRIMARY KEY$$ ELSE core_column END;
    END LOOP;
    IF alter_t THEN -- Open alter table = needs a semicolon
        query:=query || $$;$$;
        IF 'audit_id bigint' = ANY(auditor_cores) THEN -- We added a primary key...
            -- Fun! Drop the default on audit_id, drop the auto-created sequence, create a new one, and set the current value
            -- For added fun, we have to execute in chunks due to the parser checking setval/currval arguments at parse time.
            EXECUTE query;
            EXECUTE $$ALTER TABLE auditor.$$ || current_audit_table || $$ ALTER COLUMN audit_id DROP DEFAULT; $$ ||
                $$CREATE SEQUENCE auditor.$$ || current_audit_table || $$_pkey_seq;$$;
            EXECUTE $$SELECT setval('auditor.$$ || current_audit_table || $$_pkey_seq', currval('auditor.$$ || current_audit_table || $$_audit_id_seq')); $$ ||
                $$DROP SEQUENCE auditor.$$ || current_audit_table || $$_audit_id_seq;$$;
            query:='';
        END IF;
    END IF;
    EXECUTE query;
END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="get_audit_info()" returnType="TABLE(eg_user integer, eg_ws integer)" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plperlu"><![CDATA[return [{eg_user => $_SHARED{"eg_audit_user"}, eg_ws => $_SHARED{"eg_audit_ws"}}];]]></definition>
         <parameters>
            <parameter mode="TABLE" name="eg_user" type="integer"/>
            <parameter mode="TABLE" name="eg_ws" type="integer"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="set_audit_info(integer, integer)" returnType="void" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plperlu"><![CDATA[$_SHARED{"eg_audit_user"} = $_[0];
    $_SHARED{"eg_audit_ws"} = $_[1];]]></definition>
         <parameters>
            <parameter mode="IN" type="integer"/>
            <parameter mode="IN" type="integer"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="update_auditors()" returnType="boolean" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[DECLARE
    auditor_name TEXT;
    table_schema TEXT;
    table_name TEXT;
BEGIN
    -- Drop Lifecycle view(s) before potential column changes
    FOR auditor_name IN
        SELECT c.relname
            FROM pg_catalog.pg_class c
                JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE relkind = 'v' AND n.nspname = 'auditor' LOOP
        EXECUTE $$ DROP VIEW auditor.$$ || auditor_name || $$;$$;
    END LOOP;
    -- Fix all column discrepencies
    PERFORM auditor.fix_columns();
    -- Re-create trigger functions and lifecycle views
    FOR table_schema, table_name IN
        WITH audit_tables AS (
            SELECT c.oid AS audit_oid, c.relname AS audit_table
            FROM pg_catalog.pg_class c
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            WHERE relkind='r' AND nspname = 'auditor'
        ),
        table_set AS (
            SELECT a.audit_oid, a.audit_table, c.oid AS main_oid, n.nspname as main_namespace, c.relname as main_table
            FROM pg_catalog.pg_class c
            JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
            JOIN audit_tables a ON a.audit_table = n.nspname || '_' || c.relname || '_history'
            WHERE relkind = 'r'
        )
        SELECT main_namespace, main_table FROM table_set LOOP
        
        PERFORM auditor.create_auditor_func(table_schema, table_name);
        PERFORM auditor.create_auditor_lifecycle(table_schema, table_name);
    END LOOP;
    RETURN TRUE;
END;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
   </routines>
</database>
