-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO incident DO INSTEAD UPDATE public.incdt SET incdt_crmacct_id = public.getcrmacctid(new.crm_account), incdt_cntct_id = public.savecntct(public.getcntctid(new.contact_number), new.contact_number, NULL::integer, new.honorific, new.first, new.middle, new.last, new.suffix, new.phone, NULL::text, new.fax, new.email, NULL::text, new.job_title, new.contact_change), incdt_descrip = new.notes, incdt_summary = new.description, incdt_item_id = public.getitemid(new.item_number), incdt_status = CASE WHEN (new.status = 'New'::text) THEN 'N'::text WHEN (new.status = 'Feedback'::text) THEN 'F'::text WHEN (new.status = 'Confirmed'::text) THEN 'C'::text WHEN (new.status = 'Assigned'::text) THEN 'A'::text WHEN (new.status = 'Resolved'::text) THEN 'R'::text WHEN (new.status = 'Closed'::text) THEN 'L'::text ELSE NULL::text END, incdt_assigned_username = new.assigned_to, incdt_incdtcat_id = public.getincdtcatid(new.category), incdt_incdtseverity_id = public.getincdtseverityid(new.severity), incdt_incdtpriority_id = public.getincdtpriorityid(new.priority), incdt_incdtresolution_id = public.getincdtresolutionid(new.resolution), incdt_lotserial = new.lot_serial_number, incdt_ls_id = public.getlotserialid(new.item_number, new.lot_serial_number) WHERE (incdt.incdt_id = public.getincidentid(old.incident_number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO incidentchar DO INSTEAD UPDATE public.charass SET charass_value = new.value WHERE (((charass.charass_target_type = 'INCDT'::text) AND (charass.charass_target_id = public.getincidentid(old.incident_number))) AND (charass.charass_char_id = public.getcharid((old.characteristic)::text, 'INCDT'::text)));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO incidentcomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO incidentfile DO INSTEAD UPDATE public.url SET url_title = new.title, url_url = new.url WHERE ((((url.url_source_id = public.getincidentid(old.incident_number)) AND (url.url_source = 'INCDT'::text)) AND (url.url_title = old.title)) AND (url.url_url = old.url));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO incidentimage DO INSTEAD UPDATE public.imageass SET imageass_image_id = public.getimageid(new.image_name) WHERE (((imageass.imageass_source_id = public.getincidentid(old.incident_number)) AND (imageass.imageass_source = 'INCDT'::text)) AND (imageass.imageass_image_id = public.getimageid(old.image_name)));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO invoice DO INSTEAD UPDATE public.invchead SET invchead_invcnumber = old.invoice_number, invchead_ordernumber = new.order_number, invchead_invcdate = new.invoice_date, invchead_shipdate = new.ship_date, invchead_orderdate = new.order_date, invchead_salesrep_id = public.getsalesrepid(new.sales_rep), invchead_commission = new.commission, invchead_taxzone_id = public.gettaxzoneid(NULLIF(new.tax_zone, 'None'::text)), invchead_terms_id = public.gettermsid(new.terms), invchead_cust_id = (SELECT public.getcustid(new.customer_number) AS getcustid), invchead_billto_name = new.billto_name, invchead_billto_address1 = new.billto_address1, invchead_billto_address2 = new.billto_address2, invchead_billto_address3 = new.billto_address3, invchead_billto_city = new.billto_city, invchead_billto_state = new.billto_state, invchead_billto_zipcode = new.billto_postal_code, invchead_billto_country = new.billto_country, invchead_billto_phone = new.billto_phone, invchead_shipto_id = COALESCE(public.getshiptoid(new.customer_number, new.shipto_number), (-1)), invchead_shipto_name = new.shipto_name, invchead_shipto_address1 = new.shipto_address1, invchead_shipto_address2 = new.shipto_address2, invchead_shipto_address3 = new.shipto_address3, invchead_shipto_city = new.shipto_city, invchead_shipto_state = new.shipto_state, invchead_shipto_zipcode = new.shipto_postal_code, invchead_shipto_country = new.shipto_country, invchead_shipto_phone = new.shipto_phone, invchead_ponumber = new.po_number, invchead_shipvia = new.ship_via, invchead_prj_id = COALESCE(public.getprjid(new.project_number), (-1)), invchead_fob = new.fob, invchead_misc_descrip = new.misc_charge_description, invchead_misc_amount = new.misc_charge, invchead_misc_accnt_id = COALESCE(public.getglaccntid(new.misc_charge_account_number), (-1)), invchead_freight = new.freight, invchead_curr_id = COALESCE(public.getcurrid((new.currency)::text), (-1)), invchead_payment = new.payment, invchead_notes = new.notes, invchead_saletype_id = public.getsaletypeid(new.sale_type), invchead_shipzone_id = public.getshipzoneid(new.shipto_shipzone) WHERE ((invchead.invchead_invcnumber = old.invoice_number) AND (invchead.invchead_posted = false));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO invoiceline DO INSTEAD SELECT public.updateinvoicelineitem(new.*, old.*) AS updateinvoicelineitem;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO item DO INSTEAD UPDATE public.item SET item_active = new.active, item_descrip1 = new.description1, item_descrip2 = new.description2, item_type = CASE WHEN (new.item_type = 'Purchased'::text) THEN 'P'::text WHEN (new.item_type = 'Manufactured'::text) THEN 'M'::text WHEN (new.item_type = 'Job'::text) THEN 'J'::text WHEN (new.item_type = 'Kit'::text) THEN 'K'::text WHEN (new.item_type = 'Phantom'::text) THEN 'F'::text WHEN (new.item_type = 'Reference'::text) THEN 'R'::text WHEN (new.item_type = 'Costing'::text) THEN 'S'::text WHEN (new.item_type = 'Tooling'::text) THEN 'T'::text WHEN (new.item_type = 'Outside Process'::text) THEN 'O'::text WHEN (new.item_type = 'Planning'::text) THEN 'L'::text WHEN (new.item_type = 'Breeder'::text) THEN 'B'::text WHEN (new.item_type = 'Co-Product'::text) THEN 'C'::text WHEN (new.item_type = 'By-Product'::text) THEN 'Y'::text ELSE NULL::text END, item_maxcost = new.maximum_desired_cost, item_classcode_id = public.getclasscodeid(new.class_code), item_inv_uom_id = public.getuomid(new.inventory_uom), item_picklist = new.pick_list_item, item_fractional = new.fractional, item_config = new.configured, item_sold = new.item_is_sold, item_prodcat_id = COALESCE(public.getprodcatid(new.product_category), (-1)), item_exclusive = new.exclusive, item_listprice = new.list_price, item_listcost = new.list_cost, item_price_uom_id = public.getuomid(new.list_price_uom), item_upccode = new.upc_code, item_prodweight = new.product_weight, item_packweight = new.packaging_weight, item_comments = new.notes, item_extdescrip = new.ext_description WHERE (item.item_id = public.getitemid((old.item_number)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemalias DO INSTEAD UPDATE public.itemalias SET itemalias_number = new.alias_number, itemalias_usedescrip = new.use_description, itemalias_descrip1 = new.description1, itemalias_descrip2 = new.description2, itemalias_comments = new.comments, itemalias_crmacct_id = public.getcrmacctid(new.crmacct_number) WHERE ((itemalias.itemalias_item_id = public.getitemid((old.item_number)::text)) AND (itemalias.itemalias_number = old.alias_number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemchar DO INSTEAD UPDATE public.charass SET charass_value = new.value, charass_default = new.is_default WHERE (((charass.charass_target_type = 'I'::text) AND (charass.charass_target_id = public.getitemid((old.item_number)::text))) AND (charass.charass_char_id = public.getcharid((old.characteristic)::text, 'I'::text)));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemcomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemcost DO INSTEAD SELECT public.updateitemcost(public.getitemid((new.item_number)::text), public.getcostelemid((new.costing_element)::text), public.getcurrid((new.currency)::text), new.actual_cost, new.post_to_standard) AS updateitemcost;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemfile DO INSTEAD UPDATE public.url SET url_title = new.title, url_url = new.url WHERE ((((url.url_source_id = public.getitemid((old.item_number)::text)) AND (url.url_source = 'I'::text)) AND (url.url_title = old.title)) AND (url.url_url = old.url));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemimage DO INSTEAD SELECT public.saveimageass('I'::text, public.getitemid((new.item_number)::text), (CASE WHEN (new.purpose = 'Product Description'::text) THEN 'P'::text WHEN (new.purpose = 'Inventory Description'::text) THEN 'I'::text WHEN (new.purpose = 'Engineering Reference'::text) THEN 'E'::text WHEN (new.purpose = 'Miscellaneous'::text) THEN 'M'::text ELSE 'X'::text END)::bpchar, public.getimageid(new.image_name)) AS saveimageass;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemsite DO INSTEAD UPDATE public.itemsite SET itemsite_active = new.active, itemsite_dropship = new.dropship, itemsite_posupply = new.po_supplied_at_site, itemsite_createpr = new.create_prs, itemsite_wosupply = new.wo_supplied_at_site, itemsite_createwo = new.create_wos, itemsite_createsopr = new.create_soprs, itemsite_createsopo = new.create_sopos, itemsite_sold = new.sold_from_site, itemsite_soldranking = new.ranking, itemsite_costmethod = CASE WHEN (new.cost_method = 'None'::text) THEN 'N'::text WHEN (new.cost_method = 'Average'::text) THEN 'A'::text WHEN (new.cost_method = 'Standard'::text) THEN 'S'::text WHEN (new.cost_method = 'Job'::text) THEN 'J'::text ELSE NULL::text END, itemsite_controlmethod = CASE WHEN (new.control_method = 'None'::text) THEN 'N'::text WHEN (new.control_method = 'Regular'::text) THEN 'R'::text WHEN (new.control_method = 'Serial #'::text) THEN 'S'::text WHEN (new.control_method = 'Lot #'::text) THEN 'L'::text ELSE NULL::text END, itemsite_perishable = new.perishable, itemsite_plancode_id = public.getplancodeid(new.planner_code), itemsite_costcat_id = public.getcostcatid(new.cost_category), itemsite_loccntrl = new.multiple_location_control, itemsite_location_id = CASE WHEN (new.location = 'N/A'::text) THEN (-1) ELSE public.getlocationid((new.site)::text, new.location) END, itemsite_recvlocation_id = CASE WHEN (new.receive_location = 'N/A'::text) THEN (-1) ELSE public.getlocationid((new.site)::text, new.receive_location) END, itemsite_issuelocation_id = CASE WHEN (new.issue_location = 'N/A'::text) THEN (-1) ELSE public.getlocationid((new.site)::text, new.issue_location) END, itemsite_location_dist = new.auto_distr_location, itemsite_recvlocation_dist = new.auto_distr_receive_location, itemsite_issuelocation_dist = new.auto_distr_issue_location, itemsite_location = new.user_defined_location, itemsite_location_comments = new.user_defined_location, itemsite_disallowblankwip = new.disallow_blank_wip_locations, itemsite_stocked = new.stocked, itemsite_abcclass = new.abc_class, itemsite_autoabcclass = new.allow_automatic_updates, itemsite_cyclecountfreq = new.cycl_cnt_freq, itemsite_eventfence = new.event_fence, itemsite_useparams = new.enforce_order_parameters, itemsite_reorderlevel = new.reorder_level, itemsite_ordertoqty = new.order_up_to, itemsite_minordqty = new.minimum_order, itemsite_maxordqty = new.maximum_order, itemsite_multordqty = new.order_multiple, itemsite_useparamsmanual = new.enforce_on_manual_orders, itemsite_ordergroup = new.group_mps_mrp_orders, itemsite_ordergroup_first = new.first_group, itemsite_mps_timefence = new.mps_time_fence, itemsite_leadtime = new.lead_time, itemsite_safetystock = new.safety_stock, itemsite_supply_itemsite_id = CASE WHEN (new.supplied_from_site = 'None'::text) THEN NULL::integer WHEN (new.supplied_from_site = ''::text) THEN NULL::integer ELSE public.getitemsiteid(new.supplied_from_site, (new.item_number)::text) END, itemsite_notes = new.notes, itemsite_warrpurc = new.require_warranty, itemsite_autoreg = new.auto_register, itemsite_planning_type = CASE WHEN (new.planning_system = 'None'::text) THEN 'N'::text WHEN (new.planning_system = 'MPS'::text) THEN 'S'::text ELSE 'M'::text END WHERE (itemsite.itemsite_id = public.getitemsiteid((old.site)::text, (old.item_number)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemsitecomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemsource DO INSTEAD UPDATE public.itemsrc SET itemsrc_vend_item_number = new.vendor_item_number, itemsrc_vend_item_descrip = new.vendor_description, itemsrc_comments = new.notes, itemsrc_vend_uom = new.vendor_uom, itemsrc_invvendoruomratio = new.inventory_vendor_uom_ratio, itemsrc_minordqty = new.minimum_order, itemsrc_multordqty = new.order_multiple, itemsrc_leadtime = new.lead_time, itemsrc_ranking = new.vendor_ranking, itemsrc_active = new.active, itemsrc_default = new.itemsrc_default, itemsrc_manuf_name = new.manufacturer_name, itemsrc_manuf_item_number = new.manufacturer_item_number, itemsrc_manuf_item_descrip = new.manufacturer_description, itemsrc_upccode = new.bar_code, itemsrc_contrct_id = public.getcontrctid(new.contract_number), itemsrc_effective = COALESCE(public.getcontrcteffective(new.contract_number), new.effective_date), itemsrc_expires = COALESCE(public.getcontrctexpires(new.contract_number), new.expires_date) WHERE (((((itemsrc.itemsrc_item_id = public.getitemid((old.item_number)::text)) AND (itemsrc.itemsrc_vend_id = public.getvendid((old.vendor)::text))) AND (itemsrc.itemsrc_vend_item_number = old.vendor_item_number)) AND (itemsrc.itemsrc_manuf_name = old.manufacturer_name)) AND (itemsrc.itemsrc_manuf_item_number = old.manufacturer_item_number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemsourceprice DO INSTEAD UPDATE public.itemsrcp SET itemsrcp_qtybreak = new.qty_break, itemsrcp_price = new.price_per_unit, itemsrcp_updated = now(), itemsrcp_curr_id = public.getcurrid((new.currency)::text), itemsrcp_dropship = COALESCE(new.dropship_only, false), itemsrcp_warehous_id = CASE WHEN (new.pricing_site = 'All'::text) THEN (-1) ELSE COALESCE(public.getwarehousid(new.pricing_site, 'ALL'::text), (-1)) END, itemsrcp_type = CASE WHEN (new.pricing_type = 'Discount'::text) THEN 'D'::text ELSE 'N'::text END, itemsrcp_discntprcnt = (COALESCE(new.discount_percent, 0.0) / 100.0), itemsrcp_fixedamtdiscount = new.discount_fixed_amount WHERE ((itemsrcp.itemsrcp_itemsrc_id = public.getitemsrcid((old.item_number)::text, (new.vendor)::text)) AND (itemsrcp.itemsrcp_qtybreak = old.qty_break));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemsubstitute DO INSTEAD UPDATE public.itemsub SET itemsub_uomratio = new.sub_parent_uom_ratio, itemsub_rank = new.ranking WHERE ((itemsub.itemsub_parent_item_id = public.getitemid((old.root_item_number)::text)) AND (itemsub.itemsub_sub_item_id = public.getitemid((old.substitute_item_number)::text)));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemtaxtype DO INSTEAD UPDATE public.itemtax SET itemtax_taxzone_id = CASE WHEN ((new.tax_zone)::text = 'Any'::text) THEN NULL::integer ELSE public.gettaxzoneid((new.tax_zone)::text) END, itemtax_taxtype_id = public.gettaxtypeid(new.tax_type) WHERE (((itemtax.itemtax_item_id = public.getitemid((old.item_number)::text)) AND CASE WHEN ((old.tax_zone)::text = 'Any'::text) THEN (itemtax.itemtax_taxzone_id IS NULL) ELSE (itemtax.itemtax_taxzone_id = public.gettaxzoneid((old.tax_zone)::text)) END) AND (itemtax.itemtax_taxtype_id = public.gettaxtypeid(old.tax_type)));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO itemuomconversion DO INSTEAD SELECT public.saveitemuomconv(public.getitemid((new.item_number)::text), COALESCE(public.getuomid((new.uom)::text), (SELECT item.item_inv_uom_id FROM public.item WHERE (item.item_id = public.getitemid((new.item_number)::text)))), COALESCE(new.uom_value, (1)::numeric), COALESCE(public.getuomid(new.per_uom), (SELECT item.item_inv_uom_id FROM public.item WHERE (item.item_id = public.getitemid((new.item_number)::text)))), COALESCE(new.per_uom_value, (1)::numeric), COALESCE(new.fractional, false), public.getuomtypeid(new.selected_types)) AS saveitemuomconv;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO journalentry DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO location DO INSTEAD UPDATE public.location SET location_name = new.location, location_descrip = new.description, location_restrict = new.restricted, location_netable = new.netable, location_usable = new.usable, location_whsezone_id = public.getwhsezoneid((new.site)::text, new.zone), location_aisle = new.aisle, location_rack = new.rack, location_bin = new.bin WHERE ((location.location_warehous_id = public.getwarehousid((old.site)::text, 'ACTIVE'::text)) AND (location.location_name = (old.location)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO misccounttag DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO pricingschedule DO INSTEAD UPDATE public.ipshead SET ipshead_descrip = new.description, ipshead_effective = CASE WHEN (new.effective = 'Always'::text) THEN '1970-01-01'::date ELSE (new.effective)::date END, ipshead_expires = CASE WHEN (new.expires = 'Never'::text) THEN '2100-01-01'::date ELSE (new.expires)::date END, ipshead_updated = now(), ipshead_curr_id = CASE WHEN (SELECT (count(ipsiteminfo.ipsitem_id) = 0) FROM public.ipsiteminfo WHERE (ipsiteminfo.ipsitem_ipshead_id = public.getipsheadid((old.name)::text))) THEN COALESCE(public.getcurrid((new.currency)::text), public.basecurrid()) ELSE public.getcurrid((old.currency)::text) END WHERE (ipshead.ipshead_name = (old.name)::text);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO pricingscheduleassign DO INSTEAD UPDATE public.ipsass SET ipsass_ipshead_id = public.getipsheadid((new.pricing_schedule)::text), ipsass_cust_id = CASE WHEN ((new.customer_number)::text = 'Any'::text) THEN (-1) ELSE public.getcustid((new.customer_number)::text) END, ipsass_custtype_id = CASE WHEN ((new.customer_type)::text = 'N/A'::text) THEN (-1) ELSE public.getcusttypeid((new.customer_type)::text) END, ipsass_custtype_pattern = new.customer_type_pattern, ipsass_shipto_id = CASE WHEN (((new.customer_number)::text = 'Any'::text) OR ((new.customer_shipto)::text = 'Any'::text)) THEN (-1) ELSE public.getshiptoid((new.customer_number)::text, (new.customer_shipto)::text) END, ipsass_shipto_pattern = new.customer_shipto_pattern WHERE ((((((ipsass.ipsass_ipshead_id = public.getipsheadid((old.pricing_schedule)::text)) AND (ipsass.ipsass_cust_id = CASE WHEN ((old.customer_number)::text = 'Any'::text) THEN (-1) ELSE public.getcustid((old.customer_number)::text) END)) AND (ipsass.ipsass_custtype_id = CASE WHEN ((old.customer_type)::text = 'N/A'::text) THEN (-1) ELSE public.getcusttypeid((old.customer_type)::text) END)) AND (ipsass.ipsass_custtype_pattern = (old.customer_type_pattern)::text)) AND (ipsass.ipsass_shipto_id = CASE WHEN ((old.customer_shipto)::text = 'Any'::text) THEN (-1) ELSE public.getshiptoid((old.customer_number)::text, (old.customer_shipto)::text) END)) AND (ipsass.ipsass_shipto_pattern = (old.customer_shipto_pattern)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO pricingscheduleitem DO INSTEAD SELECT CASE WHEN ((old.type)::text = 'Item'::text) THEN public.saveipsitem(public.getipsitemid((old.pricing_schedule)::text, (old.item_number)::text, old.qty_break, (old.qty_uom)::text, (old.price_uom)::text), public.getipsheadid((new.pricing_schedule)::text), public.getitemid((new.item_number)::text), new.qty_break, new.price, public.getuomid((new.qty_uom)::text), public.getuomid((new.price_uom)::text), new.percent, new.fixedamt, CASE new.pricing_type WHEN 'Nominal'::text THEN 'N'::text WHEN 'Discount'::text THEN 'D'::text WHEN 'Markup'::text THEN 'M'::text ELSE '?'::text END) WHEN ((old.type)::text = 'Product Category'::text) THEN public.saveipsprodcat(public.getipsprodcatid((old.pricing_schedule)::text, (old.product_category)::text, old.qty_break), public.getipsheadid((new.pricing_schedule)::text), public.getprodcatid((new.product_category)::text), new.qty_break, new.percent, new.fixedamt, CASE new.pricing_type WHEN 'Nominal'::text THEN 'N'::text WHEN 'Discount'::text THEN 'D'::text WHEN 'Markup'::text THEN 'M'::text ELSE '?'::text END) ELSE NULL::integer END AS result;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO pricingscheduleitemchar DO INSTEAD UPDATE public.ipsitemchar SET ipsitemchar_price = new.price WHERE (((ipsitemchar.ipsitemchar_ipsitem_id = public.getipsitemid((old.pricing_schedule)::text, (old.item_number)::text, old.qty_break, (old.qty_uom)::text, (old.price_uom)::text)) AND (ipsitemchar.ipsitemchar_char_id = public.getcharid((old.characteristic)::text, 'I'::text))) AND (ipsitemchar.ipsitemchar_value = (old.value)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO project DO INSTEAD UPDATE public.prj SET prj_name = new.name, prj_descrip = new.description, prj_owner_username = new.owner, prj_username = new.assigned_to, prj_so = new.sales_orders, prj_wo = new.work_orders, prj_po = new.purchase_orders, prj_status = CASE WHEN (new.status = 'In-Process'::text) THEN 'O'::text WHEN (new.status = 'Completed'::text) THEN 'C'::text ELSE 'P'::text END, prj_due_date = new.due, prj_assigned_date = new.assigned, prj_start_date = new.started, prj_completed_date = new.completed WHERE (prj.prj_number = old.number);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO projectcomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO prospect DO INSTEAD UPDATE public.prospect SET prospect_number = upper((new.prospect_number)::text), prospect_name = new.prospect_name, prospect_active = new.active, prospect_cntct_id = public.getcntctid(new.contact_number), prospect_taxzone_id = public.gettaxzoneid(new.default_tax_zone), prospect_salesrep_id = public.getsalesrepid(new.sales_rep), prospect_warehous_id = public.getwarehousid(new.site_code, 'ACTIVE'::text), prospect_comments = new.notes WHERE (prospect.prospect_id = public.getprospectid((old.prospect_number)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO purchaseline DO INSTEAD UPDATE public.poitem SET poitem_duedate = new.due_date, poitem_qty_ordered = new.qty_ordered, poitem_unitprice = new.unit_price, poitem_vend_item_number = new.vend_item_number, poitem_vend_item_descrip = new.vendor_description, poitem_manuf_name = new.manufacturer_name, poitem_manuf_item_number = new.manufacturer_item_number, poitem_manuf_item_descrip = new.manufacturer_description, poitem_comments = new.notes, poitem_freight = new.freight, poitem_prj_id = public.getprjid(new.project_number), poitem_bom_rev_id = public.getrevid('BOM'::text, old.item_number, new.bill_of_materials_revision), poitem_boo_rev_id = public.getrevid('BOO'::text, old.item_number, new.bill_of_operations_revision) WHERE (poitem.poitem_id = public.getpoitemid((old.order_number)::text, old.line_number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO purchaselinechar DO INSTEAD SELECT DISTINCT public.updatecharassignment('PI'::text, poitem.poitem_id, charass.charass_char_id, new.value) AS updatecharassignment FROM public.pohead, public.poitem, public.itemsite, public.item, public.charass, public."char" WHERE (((((((((pohead.pohead_number = (old.order_number)::text) AND (pohead.pohead_id = poitem.poitem_pohead_id)) AND (poitem.poitem_linenumber = old.line_number)) AND (poitem.poitem_itemsite_id = itemsite.itemsite_id)) AND (item.item_id = itemsite.itemsite_item_id)) AND (charass.charass_target_type = 'I'::text)) AND (charass.charass_target_id = item.item_id)) AND ("char".char_id = charass.charass_char_id)) AND ("char".char_name = old.characteristic));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO purchaselinecomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO purchaseorder DO INSTEAD UPDATE public.pohead SET pohead_terms_id = public.gettermsid(new.terms), pohead_taxzone_id = public.gettaxzoneid(new.tax_zone), pohead_warehous_id = public.getwarehousid(new.receiving_site, 'ALL'::text), pohead_agent_username = new.purchasing_agent, pohead_vendaddr_id = CASE WHEN (new.alt_address = 'MAIN'::text) THEN NULL::integer ELSE public.getvendaddrid(old.vendor_number, new.alt_address) END, pohead_fob = new.fob, pohead_shipvia = new.ship_via, pohead_curr_id = public.getcurrid((new.currency)::text), pohead_freight = new.freight, pohead_comments = new.notes, pohead_dropship = new.dropship, pohead_vend_cntct_id = public.getcntctid(new.vend_contact_number), pohead_vend_cntct_honorific = new.vend_cntct_honorific, pohead_vend_cntct_first_name = new.vend_cntct_first_name, pohead_vend_cntct_middle = new.vend_cntct_middle, pohead_vend_cntct_last_name = new.vend_cntct_last_name, pohead_vend_cntct_suffix = new.vend_cntct_suffix, pohead_vend_cntct_phone = new.vend_cntct_phone, pohead_vend_cntct_title = new.vend_cntct_title, pohead_vend_cntct_fax = new.vend_cntct_fax, pohead_vend_cntct_email = new.vend_cntct_email, pohead_vendaddress1 = new.vendaddress1, pohead_vendaddress2 = new.vendaddress2, pohead_vendaddress3 = new.vendaddress3, pohead_vendcity = new.vendcity, pohead_vendstate = new.vendstate, pohead_vendzipcode = new.vendzipcode, pohead_vendcountry = new.vendcountry, pohead_shipto_cntct_id = public.getcntctid(new.shipto_contact_number), pohead_shipto_cntct_honorific = new.shipto_cntct_honorific, pohead_shipto_cntct_first_name = new.shipto_cntct_first_name, pohead_shipto_cntct_middle = new.shipto_cntct_middle, pohead_shipto_cntct_last_name = new.shipto_cntct_last_name, pohead_shipto_cntct_suffix = new.shipto_cntct_suffix, pohead_shipto_cntct_phone = new.shipto_cntct_phone, pohead_shipto_cntct_title = new.shipto_cntct_title, pohead_shipto_cntct_fax = new.shipto_cntct_fax, pohead_shipto_cntct_email = new.shipto_cntct_email, pohead_shiptoaddress_id = public.getaddrid(new.shiptoaddress_number), pohead_shiptoaddress1 = new.shiptoaddress1, pohead_shiptoaddress2 = new.shiptoaddress2, pohead_shiptoaddress3 = new.shiptoaddress3, pohead_shiptocity = new.shiptocity, pohead_shiptostate = new.shiptostate, pohead_shiptozipcode = new.shiptozipcode, pohead_shiptocountry = new.shiptocountry, pohead_cohead_id = public.getcoheadid(new.sales_order_number) WHERE (pohead.pohead_number = (old.order_number)::text);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO purchaseordercomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO quote DO INSTEAD UPDATE public.quhead SET quhead_number = old.quote_number, quhead_cust_id = public.getcustid(new.customer_number, true), quhead_custponumber = new.cust_po_number, quhead_quotedate = new.quote_date, quhead_warehous_id = public.getwarehousid(new.site, 'SHIPPING'::text), quhead_shipto_id = public.getshiptoid(new.customer_number, new.shipto_number), quhead_shiptoname = new.shipto_name, quhead_shiptoaddress1 = new.shipto_address1, quhead_shiptoaddress2 = new.shipto_address2, quhead_shiptoaddress3 = new.shipto_address3, quhead_salesrep_id = public.getsalesrepid(new.sales_rep), quhead_terms_id = public.gettermsid(new.terms), quhead_fob = new.fob, quhead_shipvia = new.ship_via, quhead_shiptocity = new.shipto_city, quhead_shiptostate = new.shipto_state, quhead_shiptozipcode = new.shipto_postal_code, quhead_freight = new.freight, quhead_misc = new.misc_charge, quhead_ordercomments = new.order_notes, quhead_shipcomments = new.shipping_notes, quhead_shiptophone = new.shipto_phone, quhead_billtoname = new.billto_name, quhead_billtoaddress1 = new.billto_address1, quhead_billtoaddress2 = new.billto_address2, quhead_billtoaddress3 = new.billto_address3, quhead_billtocity = new.billto_city, quhead_billtostate = new.billto_state, quhead_billtozip = new.billto_postal_code, quhead_misc_accnt_id = public.getglaccntid(new.misc_account_number), quhead_misc_descrip = new.misc_charge_description, quhead_commission = new.commission, quhead_packdate = new.pack_date, quhead_prj_id = public.getprjid(new.project_number), quhead_billtocountry = new.billto_country, quhead_shiptocountry = new.shipto_country, quhead_curr_id = public.getcurrid((new.currency)::text), quhead_taxzone_id = public.gettaxzoneid(new.tax_zone), quhead_taxtype_id = public.gettaxtypeid(new.tax_type), quhead_expire = new.expire_date, quhead_saletype_id = public.getsaletypeid(new.sale_type), quhead_shipzone_id = public.getshipzoneid(new.shipto_shipzone) WHERE (quhead.quhead_number = (old.quote_number)::text);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO quotecomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO quoteline DO INSTEAD UPDATE public.quitem SET quitem_scheddate = new.scheduled_date, quitem_qtyord = new.qty_ordered, quitem_qty_uom_id = public.getuomid(new.qty_uom), quitem_qty_invuomratio = public.itemuomtouomratio(item.item_id, COALESCE(public.getuomid(new.qty_uom), item.item_inv_uom_id), item.item_inv_uom_id), quitem_price = new.net_unit_price, quitem_price_uom_id = public.getuomid(new.price_uom), quitem_price_invuomratio = public.itemuomtouomratio(item.item_id, COALESCE(public.getuomid(new.price_uom), item.item_inv_uom_id), item.item_inv_uom_id), quitem_memo = new.notes, quitem_createorder = new.create_order, quitem_order_warehous_id = public.getwarehousid(new.supplying_site, 'SHIPPING'::text), quitem_prcost = new.overwrite_po_price, quitem_taxtype_id = public.gettaxtypeid(new.tax_type) FROM public.item WHERE ((quitem.quitem_quhead_id = public.getquoteid(old.quote_number)) AND (quitem.quitem_linenumber = old.line_number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO quotelinechar DO INSTEAD SELECT DISTINCT public.updatecharassignment('QI'::text, quitem.quitem_id, charass.charass_char_id, new.value) AS updatecharassignment FROM public.quhead, public.quitem, public.itemsite, public.item, public.charass, public."char" WHERE (((((((((quhead.quhead_number = old.quote_number) AND (quhead.quhead_id = quitem.quitem_quhead_id)) AND (quitem.quitem_linenumber = old.line_number)) AND (quitem.quitem_itemsite_id = itemsite.itemsite_id)) AND (item.item_id = itemsite.itemsite_item_id)) AND (charass.charass_target_type = 'I'::text)) AND (charass.charass_target_id = item.item_id)) AND ("char".char_id = charass.charass_char_id)) AND ("char".char_name = old.characteristic));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO quotelinecomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO saleshistory DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO saleslinechar DO INSTEAD SELECT DISTINCT public.updatecharassignment('SI'::text, coitem.coitem_id, charass.charass_char_id, new.value, public.itemcharprice(item.item_id, "char".char_id, new.value, cohead.cohead_cust_id, cohead.cohead_shipto_id, coitem.coitem_qtyord, cohead.cohead_curr_id, cohead.cohead_orderdate)) AS updatecharassignment FROM public.cohead, public.coitem, public.itemsite, public.item, public.charass, public."char" WHERE (((((((((cohead.cohead_number = (old.order_number)::text) AND (cohead.cohead_id = coitem.coitem_cohead_id)) AND (coitem.coitem_id = public.getcoitemid((old.order_number)::text, old.line_number))) AND (coitem.coitem_itemsite_id = itemsite.itemsite_id)) AND (item.item_id = itemsite.itemsite_item_id)) AND (charass.charass_target_type = 'I'::text)) AND (charass.charass_target_id = item.item_id)) AND ("char".char_id = charass.charass_char_id)) AND ("char".char_name = old.characteristic));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO saleslinecomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO salesorder DO INSTEAD UPDATE public.cohead SET cohead_number = old.order_number, cohead_cust_id = public.getcustid(new.customer_number), cohead_custponumber = new.cust_po_number, cohead_orderdate = new.order_date, cohead_warehous_id = public.getwarehousid(new.site, 'SHIPPING'::text), cohead_shipto_id = public.getshiptoid(new.customer_number, new.shipto_number), cohead_shiptoname = new.shipto_name, cohead_shiptoaddress1 = new.shipto_address1, cohead_shiptoaddress2 = new.shipto_address2, cohead_shiptoaddress3 = new.shipto_address3, cohead_salesrep_id = public.getsalesrepid(new.sales_rep), cohead_terms_id = public.gettermsid(new.terms), cohead_fob = new.fob, cohead_shipvia = new.ship_via, cohead_shiptocity = new.shipto_city, cohead_shiptostate = new.shipto_state, cohead_shiptozipcode = new.shipto_postal_code, cohead_freight = CASE WHEN new.calculate_freight THEN COALESCE((SELECT sum(freightdetail.freightdata_total) AS sum FROM public.freightdetail('SO'::text, public.getcoheadid((old.order_number)::text), public.getcustid(new.customer_number), public.getshiptoid(new.customer_number, new.shipto_number), new.order_date, new.ship_via, public.getcurrid((new.currency)::text)) freightdetail(freightdata_schedule, freightdata_from, freightdata_to, freightdata_shipvia, freightdata_freightclass, freightdata_weight, freightdata_uom, freightdata_price, freightdata_type, freightdata_total, freightdata_currency)), (0)::numeric) ELSE new.freight END, cohead_calcfreight = new.calculate_freight, cohead_misc = new.misc_charge, cohead_ordercomments = new.order_notes, cohead_shipcomments = new.shipping_notes, cohead_shiptophone = new.shipto_phone, cohead_shipchrg_id = public.getshipchrgid(new.shipping_chgs), cohead_shipform_id = public.getshipformid(new.shipping_form), cohead_billtoname = new.billto_name, cohead_billtoaddress1 = new.billto_address1, cohead_billtoaddress2 = new.billto_address2, cohead_billtoaddress3 = new.billto_address3, cohead_billtocity = new.billto_city, cohead_billtostate = new.billto_state, cohead_billtozipcode = new.billto_postal_code, cohead_misc_accnt_id = public.getglaccntid(new.misc_account_number), cohead_misc_descrip = new.misc_charge_description, cohead_commission = new.commission, cohead_holdtype = CASE WHEN (new.hold_type = 'Credit'::text) THEN 'C'::text WHEN (new.hold_type = 'Shipping'::text) THEN 'S'::text WHEN (new.hold_type = 'Packing'::text) THEN 'P'::text ELSE 'N'::text END, cohead_packdate = new.pack_date, cohead_prj_id = public.getprjid(new.project_number), cohead_shipcomplete = new.ship_complete, cohead_billtocountry = new.billto_country, cohead_shiptocountry = new.shipto_country, cohead_curr_id = public.getcurrid((new.currency)::text), cohead_taxzone_id = public.gettaxzoneid(new.tax_zone), cohead_lastupdated = ('now'::text)::timestamp(6) with time zone, cohead_shipto_cntct_id = public.getcntctid(new.shipto_contact_number), cohead_shipto_cntct_honorific = new.shipto_contact_honorific, cohead_shipto_cntct_first_name = new.shipto_contact_first, cohead_shipto_cntct_middle = new.shipto_contact_middle, cohead_shipto_cntct_last_name = new.shipto_contact_last, cohead_shipto_cntct_suffix = new.shipto_contact_suffix, cohead_shipto_cntct_phone = new.shipto_contact_phone, cohead_shipto_cntct_title = new.shipto_contact_title, cohead_shipto_cntct_fax = new.shipto_contact_fax, cohead_shipto_cntct_email = new.shipto_contact_email, cohead_billto_cntct_id = public.getcntctid(new.billto_contact_number), cohead_billto_cntct_honorific = new.billto_contact_name, cohead_billto_cntct_first_name = new.billto_contact_first, cohead_billto_cntct_middle = new.billto_contact_middle, cohead_billto_cntct_last_name = new.billto_contact_last, cohead_billto_cntct_suffix = new.billto_contact_suffix, cohead_billto_cntct_phone = new.billto_contact_phone, cohead_billto_cntct_title = new.billto_contact_title, cohead_billto_cntct_fax = new.billto_contct_fax, cohead_billto_cntct_email = new.billto_contact_email, cohead_saletype_id = public.getsaletypeid(new.sale_type), cohead_shipzone_id = public.getshipzoneid(new.shipto_shipzone) WHERE (cohead.cohead_number = (old.order_number)::text);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO salesordercomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO salesrep DO INSTEAD UPDATE public.salesrep SET salesrep_active = new.active, salesrep_number = new.number, salesrep_name = new.name, salesrep_commission = (new.commission_percent * 0.01), salesrep_emp_id = public.getempid(new.employee) WHERE (salesrep.salesrep_number = (old.number)::text);


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO site DO INSTEAD UPDATE public.whsinfo SET warehous_descrip = new.description, warehous_fob = CASE WHEN new.inventory_type THEN new.default_fob ELSE NULL::text END, warehous_active = new.active, warehous_counttag_prefix = CASE WHEN new.inventory_type THEN new.next_count_tag_prefix ELSE NULL::text END, warehous_counttag_number = CASE WHEN new.inventory_type THEN new.next_count_tag_number ELSE NULL::integer END, warehous_bol_prefix = CASE WHEN new.inventory_type THEN new.next_bill_of_lading_prefix ELSE NULL::text END, warehous_bol_number = CASE WHEN new.inventory_type THEN new.next_bill_of_lading_number ELSE NULL::integer END, warehous_shipping = CASE WHEN new.inventory_type THEN new.shipping_site ELSE NULL::boolean END, warehous_useslips = CASE WHEN new.inventory_type THEN new.force_the_use_of_count_slips ELSE NULL::boolean END, warehous_usezones = CASE WHEN new.inventory_type THEN new.force_the_use_of_zones ELSE NULL::boolean END, warehous_aislesize = CASE WHEN new.inventory_type THEN new.aisle_size ELSE NULL::integer END, warehous_aislealpha = CASE WHEN new.inventory_type THEN new.aisle_allow_alpha_characters ELSE NULL::boolean END, warehous_racksize = CASE WHEN new.inventory_type THEN new.rack_size ELSE NULL::integer END, warehous_rackalpha = CASE WHEN new.inventory_type THEN new.rack_allow_alpha_characters ELSE NULL::boolean END, warehous_binsize = CASE WHEN new.inventory_type THEN new.bin_size ELSE NULL::integer END, warehous_binalpha = CASE WHEN new.inventory_type THEN new.bin_allow_alpha_characters ELSE NULL::boolean END, warehous_locationsize = CASE WHEN new.inventory_type THEN new.location_size ELSE NULL::integer END, warehous_locationalpha = CASE WHEN new.inventory_type THEN new.location_allow_alpha_characters ELSE NULL::boolean END, warehous_enforcearbl = CASE WHEN new.inventory_type THEN new.enforce_arbl_naming_convention ELSE NULL::boolean END, warehous_default_accnt_id = public.getglaccntid(new.post_unassigned_transactions_to), warehous_shipping_commission = CASE WHEN new.inventory_type THEN (new.shipping_commission * 0.01) ELSE NULL::numeric END, warehous_cntct_id = public.savecntct(public.getcntctid(new.contact_number), new.contact_number, NULL::integer, new.honorific, new.first, new.middle, new.last, new.suffix, new.phone, NULL::text, new.fax, new.email, NULL::text, new.job_title, new.contact_change), warehous_addr_id = public.saveaddr(public.getaddrid(new.address_number), new.address_number, new.address1, new.address2, new.address3, new.city, new.state, new.postal_code, new.country, new.address_change), warehous_taxzone_id = CASE WHEN new.inventory_type THEN public.gettaxzoneid(new.tax_zone) ELSE NULL::integer END, warehous_transit = CASE WHEN new.inventory_type THEN false WHEN new.transit_type THEN true ELSE NULL::boolean END, warehous_shipform_id = CASE WHEN new.transit_type THEN public.getshipformid(new.default_shipping_form) ELSE NULL::integer END, warehous_shipvia_id = CASE WHEN new.transit_type THEN public.getshipviaid(new.default_ship_via) ELSE NULL::integer END, warehous_shipcomments = CASE WHEN new.transit_type THEN new.shipping_comments ELSE NULL::text END, warehous_costcat_id = CASE WHEN new.transit_type THEN public.getcostcatid(new.default_cost_category) ELSE NULL::integer END, warehous_sitetype_id = public.getsitetypeid(new.type), warehous_sequence = new.scheduling_sequence WHERE (whsinfo.warehous_id = public.getwarehousid((old.code)::text, 'ALL'::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO sitezone DO INSTEAD UPDATE public.whsezone SET whsezone_descrip = new.description WHERE ((whsezone.whsezone_warehous_id = public.getwarehousid((old.site)::text, 'ACTIVE'::text)) AND (whsezone.whsezone_name = (old.name)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO task DO INSTEAD UPDATE public.prjtask SET prjtask_name = new.name, prjtask_descrip = new.description, prjtask_owner_username = new.owner, prjtask_username = new.assigned_to, prjtask_hours_budget = new.hours_budgeted, prjtask_hours_actual = new.hours_actual, prjtask_exp_budget = new.expenses_budgeted, prjtask_exp_actual = new.expenses_actual, prjtask_status = CASE WHEN (new.status = 'In-Process'::text) THEN 'O'::text WHEN (new.status = 'Completed'::text) THEN 'C'::text ELSE 'P'::text END, prjtask_due_date = new.due, prjtask_assigned_date = new.assigned, prjtask_start_date = new.started, prjtask_completed_date = new.completed WHERE ((prjtask.prjtask_prj_id = public.getprjid(old.project_number)) AND (prjtask.prjtask_number = old.number));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO taskcomment DO INSTEAD NOTHING;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO todo DO INSTEAD SELECT public.updatetodoitem(old.task_number, old.assigned_to, new.task_name, new.description, public.getincidentid(new.incident), COALESCE(public.getincdtcrmacctid(new.incident), public.getcrmacctid(new.account)), public.getopheadid(new.opportunity), CASE WHEN (new.date_started > ''::text) THEN (new.date_started)::date ELSE NULL::date END, CASE WHEN (new.date_due > ''::text) THEN (new.date_due)::date ELSE NULL::date END, (CASE WHEN (new.status = 'Pending Input'::text) THEN 'P'::text WHEN (new.status = 'Deferred'::text) THEN 'D'::text WHEN (new.status = 'Neither'::text) THEN 'N'::text ELSE NULL::text END)::bpchar, CASE WHEN (new.date_assigned > ''::text) THEN (new.date_assigned)::date ELSE NULL::date END, CASE WHEN (new.date_completed > ''::text) THEN (new.date_completed)::date ELSE NULL::date END, public.getincdtpriorityid(new.priority), new.notes, new.active, new.owner) AS updatetodoitem;


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO vendor DO INSTEAD UPDATE public.vendinfo SET vend_name = new.vendor_name, vend_active = new.active, vend_po = new.sells_purchase_order_items, vend_comments = new.notes, vend_pocomments = new.po_comments, vend_1099 = new.receives_1099, vend_fobsource = CASE WHEN (new.default_fob IS NULL) THEN NULL::text WHEN (new.default_fob = 'Receiving Site'::text) THEN 'W'::text ELSE 'V'::text END, vend_fob = CASE WHEN (new.default_fob IS NULL) THEN NULL::text WHEN (new.default_fob = 'Receiving Site'::text) THEN ''::text ELSE new.default_fob END, vend_terms_id = public.gettermsid(new.default_terms), vend_shipvia = new.ship_via, vend_vendtype_id = public.getvendtypeid(new.vendor_type), vend_qualified = new.qualified, vend_ediemail = new.po_edi_email, vend_ediemailbody = new.po_edi_emailbody, vend_edisubject = new.po_edi_subject, vend_edifilename = new.po_edi_filename, vend_accntnum = new.account_number, vend_emailpodelivery = new.allow_email_po_delivery, vend_restrictpurch = new.may_only_sell_item_source, vend_edicc = new.po_edi_cc, vend_curr_id = public.getcurrid((new.default_currency)::text), vend_cntct1_id = public.savecntct(public.getcntctid(new.contact1_number), new.contact1_number, NULL::integer, new.contact1_honorific, new.contact1_first, new.contact1_middle, new.contact1_last, new.contact1_suffix, new.contact1_voice, new.contact1_alternate, new.contact1_fax, new.contact1_email, new.contact1_web, new.contact1_job_title, new.contact1_change), vend_cntct2_id = public.savecntct(public.getcntctid(new.contact2_number), new.contact2_number, NULL::integer, new.contact2_honorific, new.contact2_first, new.contact2_middle, new.contact2_last, new.contact2_suffix, new.contact2_voice, new.contact2_alternate, new.contact2_fax, new.contact2_email, new.contact2_web, new.contact2_job_title, new.contact2_change), vend_addr_id = public.saveaddr(public.getaddrid(new.address_number), new.address_number, new.address1, new.address2, new.address3, new.city, new.state, new.postalcode, new.country, new.address_change), vend_match = new.matching_vo_po_amounts, vend_taxzone_id = public.gettaxzoneid(new.default_tax_zone), vend_accnt_id = COALESCE(public.getglaccntid(NULLIF(new.default_dist_gl_account, 'N/A'::text)), (-1)), vend_expcat_id = COALESCE(public.getexpcatid(NULLIF(new.default_dist_expense_category, 'N/A'::text)), (-1)), vend_tax_id = COALESCE(public.gettaxid(NULLIF(new.default_dist_tax_code, 'N/A'::text)), (-1)) WHERE (vendinfo.vend_id = public.getvendid((old.vendor_number)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO vendoraddress DO INSTEAD UPDATE public.vendaddrinfo SET vendaddr_vend_id = public.getvendid((new.vendor_number)::text), vendaddr_code = new.vendor_address_number, vendaddr_name = new.vendor_address_name, vendaddr_comments = new.notes, vendaddr_cntct_id = public.savecntct(public.getcntctid(new.contact_number), new.contact_number, public.saveaddr(public.getaddrid(new.address_number), new.address_number, new.address1, new.address2, new.address3, new.city, new.state, new.postalcode, new.country, new.address_change), new.contact_honorific, new.contact_first, new.contact_middle, new.contact_last, new.contact_suffix, new.contact_voice, new.contact_alternate, new.contact_fax, new.contact_email, new.contact_web, new.contact_job_title, new.contact_change), vendaddr_addr_id = public.saveaddr(public.getaddrid(new.address_number), new.address_number, new.address1, new.address2, new.address3, new.city, new.state, new.postalcode, new.country, new.address_change) WHERE (vendaddrinfo.vendaddr_id = public.getvendaddrid((old.vendor_number)::text, (old.vendor_address_number)::text));


--
-- Name: _UPDATE; Type: RULE; Schema: api; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO vendortype DO INSTEAD UPDATE public.vendtype SET vendtype_code = new.code, vendtype_descrip = new.description WHERE (vendtype.vendtype_code = (old.code)::text);



--
-- Name: _DELETE; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_DELETE" AS ON DELETE TO url DO INSTEAD NOTHING;


--
-- Name: _DELETE_FILE; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_DELETE_FILE" AS ON DELETE TO url WHERE (old.url_stream IS NOT NULL) DO INSTEAD SELECT deletefile(old.url_id) AS deletefile;


--
-- Name: _DELETE_URL; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_DELETE_URL" AS ON DELETE TO url WHERE (old.url_stream IS NULL) DO INSTEAD SELECT deleteurl(old.url_id) AS deleteurl;


--
-- Name: _INSERT; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_INSERT" AS ON INSERT TO url DO INSTEAD NOTHING;


--
-- Name: _INSERT_FILE; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_INSERT_FILE" AS ON INSERT TO url WHERE (new.url_stream IS NOT NULL) DO INSTEAD INSERT INTO docass (docass_id, docass_source_id, docass_source_type, docass_target_id, docass_target_type, docass_purpose) VALUES (COALESCE((new.url_id)::bigint, nextval('docass_docass_id_seq'::regclass)), new.url_source_id, new.url_source, createfile(new.url_title, new.url_url, new.url_stream), 'FILE'::text, 'S'::bpchar);


--
-- Name: _INSERT_URL; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_INSERT_URL" AS ON INSERT TO url WHERE (new.url_stream IS NULL) DO INSTEAD INSERT INTO docass (docass_id, docass_source_id, docass_source_type, docass_target_id, docass_target_type, docass_purpose) VALUES (COALESCE((new.url_id)::bigint, nextval('docass_docass_id_seq'::regclass)), new.url_source_id, new.url_source, createurl(new.url_title, new.url_url), 'URL'::text, 'S'::bpchar);


--
-- Name: _UPDATE; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_UPDATE" AS ON UPDATE TO url DO INSTEAD NOTHING;


--
-- Name: _UPDATE_FILE; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_UPDATE_FILE" AS ON UPDATE TO url WHERE (new.url_stream IS NOT NULL) DO INSTEAD UPDATE file SET file_title = new.url_title, file_stream = new.url_stream FROM docass WHERE (((docass.docass_id = old.url_id) AND (docass.docass_target_id = file.file_id)) AND (docass.docass_target_type = 'FILE'::text));


--
-- Name: _UPDATE_URL; Type: RULE; Schema: public; Owner: admin
--

CREATE RULE "_UPDATE_URL" AS ON UPDATE TO url WHERE (new.url_stream IS NULL) DO INSTEAD UPDATE urlinfo SET url_title = new.url_title, url_url = new.url_url FROM docass WHERE (((docass.docass_id = old.url_id) AND (docass.docass_target_id = urlinfo.url_id)) AND (docass.docass_target_type = 'URL'::text));



--
-- Name: pkgcmdaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaftertrigger();


--
-- Name: pkgcmdaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaltertrigger();


--
-- Name: pkgcmdargaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdargaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaftertrigger();


--
-- Name: pkgcmdargaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdargaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaltertrigger();


--
-- Name: pkgcmdargbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdargbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargbeforetrigger();


--
-- Name: pkgcmdbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgcmdbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdbeforetrigger();


--
-- Name: pkgimageaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgimageaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimageaftertrigger();


--
-- Name: pkgimagealtertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgimagealtertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagealtertrigger();


--
-- Name: pkgimagebeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgimagebeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagebeforetrigger();


--
-- Name: pkgmetasqlaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgmetasqlaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaftertrigger();


--
-- Name: pkgmetasqlaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgmetasqlaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaltertrigger();


--
-- Name: pkgmetasqlbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgmetasqlbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlbeforetrigger();


--
-- Name: pkgprivaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgprivaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaftertrigger();


--
-- Name: pkgprivaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgprivaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaltertrigger();


--
-- Name: pkgprivbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgprivbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivbeforetrigger();


--
-- Name: pkgreportaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgreportaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaftertrigger();


--
-- Name: pkgreportaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgreportaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaltertrigger();


--
-- Name: pkgreportbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgreportbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportbeforetrigger();


--
-- Name: pkgscriptaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgscriptaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaftertrigger();


--
-- Name: pkgscriptaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgscriptaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaltertrigger();


--
-- Name: pkgscriptbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkgscriptbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptbeforetrigger();


--
-- Name: pkguiformaftertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkguiformaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaftertrigger();


--
-- Name: pkguiformaltertrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkguiformaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaltertrigger();


--
-- Name: pkguiformbeforetrigger; Type: TRIGGER; Schema: fixcountry; Owner: admin
--

CREATE TRIGGER pkguiformbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformbeforetrigger();



--
-- Name: accntdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER accntdeletetrigger BEFORE DELETE ON accnt FOR EACH ROW EXECUTE PROCEDURE _accntdeletetrigger();


--
-- Name: accnttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER accnttrigger BEFORE INSERT OR UPDATE ON accnt FOR EACH ROW EXECUTE PROCEDURE _accnttrigger();


--
-- Name: accntuniquetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER accntuniquetrigger BEFORE INSERT ON accnt FOR EACH ROW EXECUTE PROCEDURE _accntuniquetrigger();


--
-- Name: addrafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER addrafterdeletetrigger AFTER DELETE ON addr FOR EACH ROW EXECUTE PROCEDURE _addrafterdeletetrigger();


--
-- Name: addrtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER addrtrigger BEFORE INSERT OR DELETE OR UPDATE ON addr FOR EACH ROW EXECUTE PROCEDURE _addrtrigger();


--
-- Name: alarmbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER alarmbeforetrigger BEFORE INSERT ON alarm FOR EACH ROW EXECUTE PROCEDURE _alarmbeforetrigger();


--
-- Name: apapplytrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER apapplytrigger BEFORE INSERT OR UPDATE ON apapply FOR EACH ROW EXECUTE PROCEDURE _apapplytrigger();


--
-- Name: apopentrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER apopentrigger BEFORE INSERT OR UPDATE ON apopen FOR EACH ROW EXECUTE PROCEDURE _apopentrigger();


--
-- Name: arapplytrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER arapplytrigger BEFORE INSERT OR UPDATE ON arapply FOR EACH ROW EXECUTE PROCEDURE _arapplytrigger();


--
-- Name: aropenaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER aropenaftertrigger AFTER INSERT OR UPDATE ON aropen FOR EACH ROW EXECUTE PROCEDURE _aropenaftertrigger();


--
-- Name: aropentrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER aropentrigger BEFORE INSERT OR UPDATE ON aropen FOR EACH ROW EXECUTE PROCEDURE _aropentrigger();


--
-- Name: bomheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER bomheadtrigger AFTER INSERT OR DELETE OR UPDATE ON bomhead FOR EACH ROW EXECUTE PROCEDURE _bomheadtrigger();


--
-- Name: bomitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER bomitemaftertrigger AFTER INSERT OR UPDATE ON bomitem FOR EACH ROW EXECUTE PROCEDURE _bomitemaftertrigger();


--
-- Name: bomitembeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER bomitembeforedeletetrigger BEFORE DELETE ON bomitem FOR EACH ROW EXECUTE PROCEDURE _bomitembeforedeletetrigger();


--
-- Name: bomitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER bomitembeforetrigger BEFORE INSERT OR UPDATE ON bomitem FOR EACH ROW EXECUTE PROCEDURE _bomitembeforetrigger();


--
-- Name: bomitemsubtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER bomitemsubtrigger BEFORE INSERT OR DELETE OR UPDATE ON bomitemsub FOR EACH ROW EXECUTE PROCEDURE _bomitemsubtrigger();


--
-- Name: cashrcptitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cashrcptitemaftertrigger AFTER INSERT OR UPDATE ON cashrcptitem FOR EACH ROW EXECUTE PROCEDURE _cashrcptitemaftertrigger();


--
-- Name: cashrcptitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cashrcptitemtrigger BEFORE INSERT OR UPDATE ON cashrcptitem FOR EACH ROW EXECUTE PROCEDURE _cashrcptitemtrigger();


--
-- Name: cashrcptmisctrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cashrcptmisctrigger BEFORE INSERT OR UPDATE ON cashrcptmisc FOR EACH ROW EXECUTE PROCEDURE _cashrcptmisctrigger();


--
-- Name: cashrcpttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cashrcpttrigger BEFORE INSERT OR UPDATE ON cashrcpt FOR EACH ROW EXECUTE PROCEDURE _cashrcpttrigger();


--
-- Name: ccardtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ccardtrigger BEFORE INSERT OR UPDATE ON ccard FOR EACH ROW EXECUTE PROCEDURE _ccardtrigger();


--
-- Name: ccpaybeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ccpaybeforetrigger BEFORE INSERT OR UPDATE ON ccpay FOR EACH ROW EXECUTE PROCEDURE _ccpaybeforetrigger();


--
-- Name: charasshistorytrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER charasshistorytrigger BEFORE INSERT OR DELETE OR UPDATE ON charass FOR EACH ROW EXECUTE PROCEDURE _charasshistorytrigger();


--
-- Name: charasstrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER charasstrigger AFTER INSERT OR UPDATE ON charass FOR EACH ROW EXECUTE PROCEDURE _charasstrigger();


--
-- Name: charbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER charbeforetrigger BEFORE INSERT OR UPDATE ON "char" FOR EACH ROW EXECUTE PROCEDURE _charbeforetrigger();


--
-- Name: charopttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER charopttrigger AFTER DELETE OR UPDATE ON charopt FOR EACH ROW EXECUTE PROCEDURE _charopttrigger();


--
-- Name: charusebeforeupserttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER charusebeforeupserttrigger BEFORE INSERT OR UPDATE ON charuse FOR EACH ROW EXECUTE PROCEDURE _charusebeforeupserttrigger();


--
-- Name: checkheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER checkheadbeforetrigger BEFORE INSERT OR UPDATE ON checkhead FOR EACH ROW EXECUTE PROCEDURE _checkheadbeforetrigger();


--
-- Name: cmheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cmheadbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON cmhead FOR EACH ROW EXECUTE PROCEDURE _cmheadbeforetrigger();


--
-- Name: cmheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cmheadtrigger AFTER INSERT OR DELETE OR UPDATE ON cmhead FOR EACH ROW EXECUTE PROCEDURE _cmheadtrigger();


--
-- Name: cmitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cmitembeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON cmitem FOR EACH ROW EXECUTE PROCEDURE _cmitembeforetrigger();


--
-- Name: cmitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cmitemtrigger AFTER INSERT OR DELETE OR UPDATE ON cmitem FOR EACH ROW EXECUTE PROCEDURE _cmitemtrigger();


--
-- Name: cntctafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cntctafterdeletetrigger AFTER DELETE ON cntct FOR EACH ROW EXECUTE PROCEDURE _cntctafterdeletetrigger();


--
-- Name: cntcttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cntcttrigger BEFORE INSERT OR UPDATE ON cntct FOR EACH ROW EXECUTE PROCEDURE _cntcttrigger();


--
-- Name: cntcttriggerafter; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cntcttriggerafter AFTER INSERT OR DELETE OR UPDATE ON cntct FOR EACH ROW EXECUTE PROCEDURE _cntcttriggerafter();


--
-- Name: cntcttriggerbeforedelete; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cntcttriggerbeforedelete BEFORE DELETE ON cntct FOR EACH ROW EXECUTE PROCEDURE _cntcttriggerbeforedelete();


--
-- Name: cntsliptrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cntsliptrigger BEFORE INSERT OR DELETE OR UPDATE ON cntslip FOR EACH ROW EXECUTE PROCEDURE _cntsliptrigger();


--
-- Name: cobillbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cobillbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON cobill FOR EACH ROW EXECUTE PROCEDURE _cobillbeforetrigger();


--
-- Name: cobilltrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cobilltrigger AFTER INSERT OR DELETE OR UPDATE ON cobill FOR EACH ROW EXECUTE PROCEDURE _cobilltrigger();


--
-- Name: cobmiscbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cobmiscbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON cobmisc FOR EACH ROW EXECUTE PROCEDURE _cobmiscbeforetrigger();


--
-- Name: cobmisctrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER cobmisctrigger AFTER INSERT OR DELETE OR UPDATE ON cobmisc FOR EACH ROW EXECUTE PROCEDURE _cobmisctrigger();


--
-- Name: coheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER coheadafterdeletetrigger AFTER DELETE ON cohead FOR EACH ROW EXECUTE PROCEDURE _coheadafterdeletetrigger();


--
-- Name: coitembeforeimptaxtypedef; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER coitembeforeimptaxtypedef BEFORE INSERT ON coitem FOR EACH ROW EXECUTE PROCEDURE _coitembeforeimptaxtypedeftrigger();


--
-- Name: commenttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER commenttrigger AFTER INSERT OR UPDATE ON comment FOR EACH ROW EXECUTE PROCEDURE _commenttrigger();


--
-- Name: companytrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER companytrigger BEFORE UPDATE ON company FOR EACH ROW EXECUTE PROCEDURE _companytrigger();


--
-- Name: contrctaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER contrctaftertrigger AFTER UPDATE ON contrct FOR EACH ROW EXECUTE PROCEDURE _contrctaftertrigger();


--
-- Name: crmacctafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER crmacctafterdeletetrigger AFTER DELETE ON crmacct FOR EACH ROW EXECUTE PROCEDURE _crmacctafterdeletetrigger();


--
-- Name: crmacctaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER crmacctaftertrigger AFTER INSERT OR DELETE OR UPDATE ON crmacct FOR EACH ROW EXECUTE PROCEDURE _crmacctaftertrigger();


--
-- Name: crmacctbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER crmacctbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON crmacct FOR EACH ROW EXECUTE PROCEDURE _crmacctbeforetrigger();


--
-- Name: currexchangecheckoverlap; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER currexchangecheckoverlap BEFORE INSERT OR UPDATE ON curr_rate FOR EACH ROW EXECUTE PROCEDURE currexchangecheckoverlap();


--
-- Name: curronebase; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER curronebase AFTER INSERT OR UPDATE ON curr_symbol FOR EACH ROW EXECUTE PROCEDURE curronebase();


--
-- Name: custaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custaftertrigger AFTER INSERT OR UPDATE ON custinfo FOR EACH ROW EXECUTE PROCEDURE _custaftertrigger();


--
-- Name: custinfoafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custinfoafterdeletetrigger AFTER DELETE ON custinfo FOR EACH ROW EXECUTE PROCEDURE _custinfoafterdeletetrigger();


--
-- Name: custinfobeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custinfobeforedeletetrigger BEFORE DELETE ON custinfo FOR EACH ROW EXECUTE PROCEDURE _custinfobeforedeletetrigger();


--
-- Name: custtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custtrigger BEFORE INSERT OR UPDATE ON custinfo FOR EACH ROW EXECUTE PROCEDURE _custtrigger();


--
-- Name: custtypeafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custtypeafterdeletetrigger AFTER DELETE ON custtype FOR EACH ROW EXECUTE PROCEDURE _custtypeafterdeletetrigger();


--
-- Name: custtypetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER custtypetrigger BEFORE INSERT OR UPDATE ON custtype FOR EACH ROW EXECUTE PROCEDURE _custtypetrigger();


--
-- Name: docasstrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER docasstrigger AFTER INSERT OR UPDATE ON docass FOR EACH ROW EXECUTE PROCEDURE _docasstrigger();


--
-- Name: empafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER empafterdeletetrigger AFTER DELETE ON emp FOR EACH ROW EXECUTE PROCEDURE _empafterdeletetrigger();


--
-- Name: empaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER empaftertrigger AFTER INSERT OR UPDATE ON emp FOR EACH ROW EXECUTE PROCEDURE _empaftertrigger();


--
-- Name: empbeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER empbeforedeletetrigger BEFORE DELETE ON emp FOR EACH ROW EXECUTE PROCEDURE _empbeforedeletetrigger();


--
-- Name: empbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER empbeforetrigger BEFORE INSERT OR UPDATE ON emp FOR EACH ROW EXECUTE PROCEDURE _empbeforetrigger();


--
-- Name: evntlogafterinserttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER evntlogafterinserttrigger AFTER INSERT ON evntlog FOR EACH ROW EXECUTE PROCEDURE _evntlogafterinserttrigger();


--
-- Name: gltransaltertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER gltransaltertrigger BEFORE DELETE OR UPDATE ON gltrans FOR EACH ROW EXECUTE PROCEDURE _gltransaltertrigger();


--
-- Name: gltransinserttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER gltransinserttrigger BEFORE INSERT ON gltrans FOR EACH ROW EXECUTE PROCEDURE _gltransinserttrigger();


--
-- Name: grpprivtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER grpprivtrigger BEFORE INSERT OR UPDATE ON grppriv FOR EACH ROW EXECUTE PROCEDURE _grpprivtrigger();


--
-- Name: imageasstrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER imageasstrigger AFTER INSERT OR UPDATE ON imageass FOR EACH ROW EXECUTE PROCEDURE _imageasstrigger();


--
-- Name: incdtafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER incdtafterdeletetrigger AFTER DELETE ON incdt FOR EACH ROW EXECUTE PROCEDURE _incdtafterdeletetrigger();


--
-- Name: incdtbeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER incdtbeforedeletetrigger BEFORE DELETE ON incdt FOR EACH ROW EXECUTE PROCEDURE _incdtbeforedeletetrigger();


--
-- Name: incdtbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER incdtbeforetrigger BEFORE INSERT OR UPDATE ON incdt FOR EACH ROW EXECUTE PROCEDURE _incdtbeforetrigger();


--
-- Name: incdttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER incdttrigger AFTER INSERT OR DELETE OR UPDATE ON incdt FOR EACH ROW EXECUTE PROCEDURE _incdttrigger();


--
-- Name: invcheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcheadafterdeletetrigger AFTER DELETE ON invchead FOR EACH ROW EXECUTE PROCEDURE _invcheadafterdeletetrigger();


--
-- Name: invcheadaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcheadaftertrigger AFTER UPDATE ON invchead FOR EACH ROW EXECUTE PROCEDURE _invcheadaftertrigger();


--
-- Name: invcheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcheadbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON invchead FOR EACH ROW EXECUTE PROCEDURE _invcheadbeforetrigger();


--
-- Name: invcheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcheadtrigger AFTER INSERT OR DELETE OR UPDATE ON invchead FOR EACH ROW EXECUTE PROCEDURE _invcheadtrigger();


--
-- Name: invcitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcitembeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON invcitem FOR EACH ROW EXECUTE PROCEDURE _invcitembeforetrigger();


--
-- Name: invcitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invcitemtrigger AFTER INSERT OR DELETE OR UPDATE ON invcitem FOR EACH ROW EXECUTE PROCEDURE _invcitemtrigger();


--
-- Name: invhisttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER invhisttrigger BEFORE INSERT OR UPDATE ON invhist FOR EACH ROW EXECUTE PROCEDURE invhisttrig();


--
-- Name: ipsassbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ipsassbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON ipsass FOR EACH ROW EXECUTE PROCEDURE _ipsassbeforetrigger();


--
-- Name: ipsheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ipsheadbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON ipshead FOR EACH ROW EXECUTE PROCEDURE _ipsheadbeforetrigger();


--
-- Name: ipsitemcharbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ipsitemcharbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON ipsitemchar FOR EACH ROW EXECUTE PROCEDURE _ipsitemcharbeforetrigger();


--
-- Name: ipsiteminfobeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER ipsiteminfobeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON ipsiteminfo FOR EACH ROW EXECUTE PROCEDURE _ipsiteminfobeforetrigger();


--
-- Name: item_uom_check; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER item_uom_check BEFORE INSERT OR UPDATE ON item FOR EACH ROW EXECUTE PROCEDURE _item_uom_check();


--
-- Name: itemafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemafterdeletetrigger AFTER DELETE ON item FOR EACH ROW EXECUTE PROCEDURE _itemafterdeletetrigger();


--
-- Name: itemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemaftertrigger AFTER INSERT OR DELETE OR UPDATE ON item FOR EACH ROW EXECUTE PROCEDURE _itemaftertrigger();


--
-- Name: itemcostaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemcostaftertrigger AFTER INSERT OR UPDATE ON itemcost FOR EACH ROW EXECUTE PROCEDURE _itemcostaftertrigger();


--
-- Name: itemcosttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemcosttrigger BEFORE INSERT OR DELETE OR UPDATE ON itemcost FOR EACH ROW EXECUTE PROCEDURE _itemcosttrigger();


--
-- Name: itemsiteaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsiteaftertrigger AFTER INSERT OR UPDATE ON itemsite FOR EACH ROW EXECUTE PROCEDURE _itemsiteaftertrigger();


--
-- Name: itemsitetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsitetrigger BEFORE INSERT OR UPDATE ON itemsite FOR EACH ROW EXECUTE PROCEDURE _itemsitetrigger();


--
-- Name: itemsrcaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsrcaftertrigger AFTER INSERT OR UPDATE ON itemsrc FOR EACH ROW EXECUTE PROCEDURE _itemsrcaftertrigger();


--
-- Name: itemsrcptrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsrcptrigger BEFORE INSERT OR UPDATE ON itemsrcp FOR EACH ROW EXECUTE PROCEDURE _itemsrcptrigger();


--
-- Name: itemsrctrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsrctrigger BEFORE INSERT OR UPDATE ON itemsrc FOR EACH ROW EXECUTE PROCEDURE _itemsrctrigger();


--
-- Name: itemsubtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemsubtrigger AFTER INSERT OR UPDATE ON itemsub FOR EACH ROW EXECUTE PROCEDURE _itemsubtrigger();


--
-- Name: itemtaxtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemtaxtrigger AFTER INSERT OR UPDATE ON itemtax FOR EACH ROW EXECUTE PROCEDURE _itemtaxtrigger();


--
-- Name: itemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemtrigger BEFORE INSERT OR UPDATE ON item FOR EACH ROW EXECUTE PROCEDURE _itemtrigger();


--
-- Name: itemuomconvtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER itemuomconvtrigger AFTER INSERT OR UPDATE ON itemuomconv FOR EACH ROW EXECUTE PROCEDURE _itemuomconvtrigger();


--
-- Name: locationaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER locationaftertrigger AFTER INSERT OR UPDATE ON location FOR EACH ROW EXECUTE PROCEDURE _locationaftertrigger();


--
-- Name: locationtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER locationtrigger BEFORE INSERT OR UPDATE ON location FOR EACH ROW EXECUTE PROCEDURE _locationtrigger();


--
-- Name: metasqlaltertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER metasqlaltertrigger BEFORE INSERT OR UPDATE ON metasql FOR EACH ROW EXECUTE PROCEDURE _metasqlaltertrigger();


--
-- Name: metasqltrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER metasqltrigger BEFORE INSERT OR UPDATE ON metasql FOR EACH ROW EXECUTE PROCEDURE _metasqltrigger();


--
-- Name: opheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER opheadafterdeletetrigger AFTER DELETE ON ophead FOR EACH ROW EXECUTE PROCEDURE _opheadafterdeletetrigger();


--
-- Name: opheadaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER opheadaftertrigger AFTER INSERT OR DELETE OR UPDATE ON ophead FOR EACH ROW EXECUTE PROCEDURE _opheadaftertrigger();


--
-- Name: opheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER opheadbeforetrigger BEFORE INSERT OR UPDATE ON ophead FOR EACH ROW EXECUTE PROCEDURE _opheadbeforetrigger();


--
-- Name: packbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER packbeforetrigger BEFORE INSERT OR UPDATE ON pack FOR EACH ROW EXECUTE PROCEDURE _packbeforetrigger();


--
-- Name: periodaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER periodaftertrigger AFTER INSERT OR DELETE OR UPDATE ON period FOR EACH STATEMENT EXECUTE PROCEDURE _periodaftertrigger();


--
-- Name: pkgheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER pkgheadbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkghead FOR EACH ROW EXECUTE PROCEDURE _pkgheadbeforetrigger();


--
-- Name: pkgitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER pkgitembeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgitem FOR EACH ROW EXECUTE PROCEDURE _pkgitembeforetrigger();


--
-- Name: poheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poheadafterdeletetrigger AFTER DELETE ON pohead FOR EACH ROW EXECUTE PROCEDURE _poheadafterdeletetrigger();


--
-- Name: poheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poheadtrigger BEFORE INSERT OR DELETE OR UPDATE ON pohead FOR EACH ROW EXECUTE PROCEDURE _poheadtrigger();


--
-- Name: poheadtriggerafter; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poheadtriggerafter AFTER UPDATE ON pohead FOR EACH ROW EXECUTE PROCEDURE _poheadtriggerafter();


--
-- Name: poitemafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poitemafterdeletetrigger AFTER DELETE ON poitem FOR EACH ROW EXECUTE PROCEDURE _poitemafterdeletetrigger();


--
-- Name: poitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poitemaftertrigger AFTER INSERT OR UPDATE ON poitem FOR EACH ROW EXECUTE PROCEDURE _poitemaftertrigger();


--
-- Name: poitemdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poitemdeletetrigger BEFORE DELETE ON poitem FOR EACH ROW EXECUTE PROCEDURE _poitemdeletetrigger();


--
-- Name: poitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER poitemtrigger BEFORE INSERT OR UPDATE ON poitem FOR EACH ROW EXECUTE PROCEDURE _poitemtrigger();


--
-- Name: prjafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjafterdeletetrigger AFTER DELETE ON prj FOR EACH ROW EXECUTE PROCEDURE _prjafterdeletetrigger();


--
-- Name: prjaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjaftertrigger AFTER INSERT OR UPDATE ON prj FOR EACH ROW EXECUTE PROCEDURE _prjaftertrigger();


--
-- Name: prjbeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjbeforedeletetrigger BEFORE DELETE ON prj FOR EACH ROW EXECUTE PROCEDURE _prjbeforedeletetrigger();


--
-- Name: prjtaskafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjtaskafterdeletetrigger AFTER DELETE ON prjtask FOR EACH ROW EXECUTE PROCEDURE _prjtaskafterdeletetrigger();


--
-- Name: prjtaskaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjtaskaftertrigger AFTER INSERT OR UPDATE ON prjtask FOR EACH ROW EXECUTE PROCEDURE _prjtaskaftertrigger();


--
-- Name: prjtasktrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prjtasktrigger BEFORE INSERT OR UPDATE ON prjtask FOR EACH ROW EXECUTE PROCEDURE _prjtasktrigger();


--
-- Name: prospectafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prospectafterdeletetrigger AFTER DELETE ON prospect FOR EACH ROW EXECUTE PROCEDURE _prospectafterdeletetrigger();


--
-- Name: prospectaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prospectaftertrigger AFTER INSERT OR UPDATE ON prospect FOR EACH ROW EXECUTE PROCEDURE _prospectaftertrigger();


--
-- Name: prospectbeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prospectbeforedeletetrigger BEFORE DELETE ON prospect FOR EACH ROW EXECUTE PROCEDURE _prospectbeforedeletetrigger();


--
-- Name: prospecttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prospecttrigger BEFORE INSERT OR UPDATE ON prospect FOR EACH ROW EXECUTE PROCEDURE _prospecttrigger();


--
-- Name: prtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER prtrigger AFTER INSERT ON pr FOR EACH ROW EXECUTE PROCEDURE _prtrigger();


--
-- Name: quheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quheadafterdeletetrigger AFTER DELETE ON quhead FOR EACH ROW EXECUTE PROCEDURE _quheadafterdeletetrigger();


--
-- Name: quheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quheadtrigger BEFORE INSERT OR DELETE OR UPDATE ON quhead FOR EACH ROW EXECUTE PROCEDURE _quheadtrigger();


--
-- Name: quitemafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quitemafterdeletetrigger AFTER DELETE ON quitem FOR EACH ROW EXECUTE PROCEDURE _quitemafterdeletetrigger();


--
-- Name: quitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quitemaftertrigger AFTER INSERT OR UPDATE ON quitem FOR EACH ROW EXECUTE PROCEDURE _quitemaftertrigger();


--
-- Name: quitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quitembeforetrigger BEFORE INSERT OR UPDATE ON quitem FOR EACH ROW EXECUTE PROCEDURE _quitembeforetrigger();


--
-- Name: quitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER quitemtrigger BEFORE INSERT OR DELETE OR UPDATE ON quitem FOR EACH ROW EXECUTE PROCEDURE _quitemtrigger();


--
-- Name: recuraftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER recuraftertrigger AFTER DELETE ON recur FOR EACH ROW EXECUTE PROCEDURE _recuraftertrigger();


--
-- Name: reporttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER reporttrigger BEFORE INSERT OR UPDATE ON report FOR EACH ROW EXECUTE PROCEDURE _reporttrigger();


--
-- Name: salesrepafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER salesrepafterdeletetrigger AFTER DELETE ON salesrep FOR EACH ROW EXECUTE PROCEDURE _salesrepafterdeletetrigger();


--
-- Name: salesrepaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER salesrepaftertrigger AFTER INSERT OR UPDATE ON salesrep FOR EACH ROW EXECUTE PROCEDURE _salesrepaftertrigger();


--
-- Name: salesrepbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER salesrepbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON salesrep FOR EACH ROW EXECUTE PROCEDURE _salesrepbeforetrigger();


--
-- Name: saletype_after_change; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER saletype_after_change AFTER INSERT OR UPDATE ON saletype FOR EACH ROW EXECUTE PROCEDURE _saletypeaftertrigger();


--
-- Name: saletypebeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER saletypebeforedeletetrigger BEFORE DELETE ON saletype FOR EACH ROW EXECUTE PROCEDURE _saletypebeforedeletetrigger();


--
-- Name: shipdatasumtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shipdatasumtrigger BEFORE INSERT OR UPDATE ON shipdatasum FOR EACH ROW EXECUTE PROCEDURE _shipdatasumtrigger();


--
-- Name: shipdatatrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shipdatatrigger BEFORE INSERT OR UPDATE ON shipdata FOR EACH ROW EXECUTE PROCEDURE _shipdatatrigger();


--
-- Name: shipformafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shipformafterdeletetrigger AFTER DELETE ON shipform FOR EACH ROW EXECUTE PROCEDURE _shipformafterdeletetrigger();


--
-- Name: shipheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shipheadbeforetrigger BEFORE INSERT OR UPDATE ON shiphead FOR EACH ROW EXECUTE PROCEDURE _shipheadbeforetrigger();


--
-- Name: shiptoinfoaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shiptoinfoaftertrigger AFTER INSERT OR UPDATE ON shiptoinfo FOR EACH ROW EXECUTE PROCEDURE _shiptoinfoaftertrigger();


--
-- Name: shipviaafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER shipviaafterdeletetrigger AFTER DELETE ON shipvia FOR EACH ROW EXECUTE PROCEDURE _shipviaafterdeletetrigger();


--
-- Name: sltransaltertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER sltransaltertrigger BEFORE DELETE OR UPDATE ON sltrans FOR EACH ROW EXECUTE PROCEDURE _sltransaltertrigger();


--
-- Name: sltransinserttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER sltransinserttrigger BEFORE INSERT ON sltrans FOR EACH ROW EXECUTE PROCEDURE _sltransinserttrigger();


--
-- Name: soheadtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soheadtrigger BEFORE INSERT OR DELETE OR UPDATE ON cohead FOR EACH ROW EXECUTE PROCEDURE _soheadtrigger();


--
-- Name: soheadtriggerafter; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soheadtriggerafter AFTER UPDATE ON cohead FOR EACH ROW EXECUTE PROCEDURE _soheadtriggerafter();


--
-- Name: soitemafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soitemafterdeletetrigger AFTER DELETE ON coitem FOR EACH ROW EXECUTE PROCEDURE _soitemafterdeletetrigger();


--
-- Name: soitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soitemaftertrigger AFTER INSERT OR UPDATE ON coitem FOR EACH ROW EXECUTE PROCEDURE _soitemaftertrigger();


--
-- Name: soitembeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soitembeforedeletetrigger BEFORE DELETE ON coitem FOR EACH ROW EXECUTE PROCEDURE _soitembeforedeletetrigger();


--
-- Name: soitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soitembeforetrigger BEFORE INSERT OR UPDATE ON coitem FOR EACH ROW EXECUTE PROCEDURE _soitembeforetrigger();


--
-- Name: soitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER soitemtrigger BEFORE INSERT OR UPDATE ON coitem FOR EACH ROW EXECUTE PROCEDURE _soitemtrigger();


--
-- Name: sourcebeforeupserttrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER sourcebeforeupserttrigger BEFORE INSERT OR UPDATE ON source FOR EACH ROW EXECUTE PROCEDURE _sourcebeforeupserttrigger();


--
-- Name: taxauthafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER taxauthafterdeletetrigger AFTER DELETE ON taxauth FOR EACH ROW EXECUTE PROCEDURE _taxauthafterdeletetrigger();


--
-- Name: taxauthaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER taxauthaftertrigger AFTER INSERT OR UPDATE ON taxauth FOR EACH ROW EXECUTE PROCEDURE _taxauthaftertrigger();


--
-- Name: taxauthbeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER taxauthbeforedeletetrigger BEFORE DELETE ON taxauth FOR EACH ROW EXECUTE PROCEDURE _taxauthbeforedeletetrigger();


--
-- Name: taxauthbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER taxauthbeforetrigger BEFORE INSERT OR UPDATE ON taxauth FOR EACH ROW EXECUTE PROCEDURE _taxauthbeforetrigger();


--
-- Name: termsafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER termsafterdeletetrigger AFTER DELETE ON terms FOR EACH ROW EXECUTE PROCEDURE _termsafterdeletetrigger();


--
-- Name: todoitemtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER todoitemtrigger AFTER DELETE ON todoitem FOR EACH ROW EXECUTE PROCEDURE _todoitemtrigger();


--
-- Name: trialbalaltertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER trialbalaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON trialbal FOR EACH ROW EXECUTE PROCEDURE _trialbalaltertrigger();


--
-- Name: uomconvupdate; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER uomconvupdate BEFORE UPDATE ON uomconv FOR EACH ROW EXECUTE PROCEDURE _uomconvupdate();


--
-- Name: usrprefaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER usrprefaftertrigger AFTER INSERT OR DELETE OR UPDATE ON usrpref FOR EACH ROW EXECUTE PROCEDURE _usrprefaftertrigger();


--
-- Name: usrprefbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER usrprefbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON usrpref FOR EACH ROW EXECUTE PROCEDURE _usrprefbeforetrigger();


--
-- Name: usrprivtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER usrprivtrigger BEFORE INSERT OR UPDATE ON usrpriv FOR EACH ROW EXECUTE PROCEDURE _usrprivtrigger();


--
-- Name: vendaddrtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vendaddrtrigger BEFORE INSERT OR DELETE OR UPDATE ON vendaddrinfo FOR EACH ROW EXECUTE PROCEDURE _vendaddrtrigger();


--
-- Name: vendaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vendaftertrigger AFTER INSERT OR UPDATE ON vendinfo FOR EACH ROW EXECUTE PROCEDURE _vendaftertrigger();


--
-- Name: vendinfoafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vendinfoafterdeletetrigger AFTER DELETE ON vendinfo FOR EACH ROW EXECUTE PROCEDURE _vendinfoafterdeletetrigger();


--
-- Name: vendinfobeforedeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vendinfobeforedeletetrigger BEFORE DELETE ON vendinfo FOR EACH ROW EXECUTE PROCEDURE _vendinfobeforedeletetrigger();


--
-- Name: vendtrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vendtrigger BEFORE INSERT OR UPDATE ON vendinfo FOR EACH ROW EXECUTE PROCEDURE _vendtrigger();


--
-- Name: vodistaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vodistaftertrigger AFTER INSERT OR DELETE OR UPDATE ON vodist FOR EACH ROW EXECUTE PROCEDURE _vodistaftertrigger();


--
-- Name: vodistbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER vodistbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON vodist FOR EACH ROW EXECUTE PROCEDURE _vodistbeforetrigger();


--
-- Name: voheadafterdeletetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER voheadafterdeletetrigger AFTER DELETE ON vohead FOR EACH ROW EXECUTE PROCEDURE _voheadafterdeletetrigger();


--
-- Name: voheadaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER voheadaftertrigger AFTER INSERT OR DELETE OR UPDATE ON vohead FOR EACH ROW EXECUTE PROCEDURE _voheadaftertrigger();


--
-- Name: voheadbeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER voheadbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON vohead FOR EACH ROW EXECUTE PROCEDURE _voheadbeforetrigger();


--
-- Name: voitemaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER voitemaftertrigger AFTER INSERT OR DELETE OR UPDATE ON voitem FOR EACH ROW EXECUTE PROCEDURE _voitemaftertrigger();


--
-- Name: voitembeforetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER voitembeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON voitem FOR EACH ROW EXECUTE PROCEDURE _voitembeforetrigger();


--
-- Name: warehoustrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER warehoustrigger BEFORE INSERT OR UPDATE ON whsinfo FOR EACH ROW EXECUTE PROCEDURE _warehoustrigger();


--
-- Name: whsezonetrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER whsezonetrigger BEFORE INSERT OR UPDATE ON whsezone FOR EACH ROW EXECUTE PROCEDURE _whsezonetrigger();


--
-- Name: womatlaftertrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER womatlaftertrigger AFTER INSERT OR DELETE OR UPDATE ON womatl FOR EACH ROW EXECUTE PROCEDURE _womatlaftertrigger();


--
-- Name: wotrigger; Type: TRIGGER; Schema: public; Owner: admin
--

CREATE TRIGGER wotrigger BEFORE INSERT OR DELETE OR UPDATE ON wo FOR EACH ROW EXECUTE PROCEDURE _wotrigger();



--
-- Name: pkgcmdaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaftertrigger();


--
-- Name: pkgcmdaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaltertrigger();


--
-- Name: pkgcmdargaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdargaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaftertrigger();


--
-- Name: pkgcmdargaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdargaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaltertrigger();


--
-- Name: pkgcmdargbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdargbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargbeforetrigger();


--
-- Name: pkgcmdbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgcmdbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdbeforetrigger();


--
-- Name: pkgimageaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgimageaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimageaftertrigger();


--
-- Name: pkgimagealtertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgimagealtertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagealtertrigger();


--
-- Name: pkgimagebeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgimagebeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagebeforetrigger();


--
-- Name: pkgmetasqlaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgmetasqlaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaftertrigger();


--
-- Name: pkgmetasqlaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgmetasqlaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaltertrigger();


--
-- Name: pkgmetasqlbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgmetasqlbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlbeforetrigger();


--
-- Name: pkgprivaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgprivaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaftertrigger();


--
-- Name: pkgprivaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgprivaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaltertrigger();


--
-- Name: pkgprivbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgprivbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivbeforetrigger();


--
-- Name: pkgreportaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgreportaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaftertrigger();


--
-- Name: pkgreportaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgreportaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaltertrigger();


--
-- Name: pkgreportbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgreportbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportbeforetrigger();


--
-- Name: pkgscriptaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgscriptaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaftertrigger();


--
-- Name: pkgscriptaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgscriptaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaltertrigger();


--
-- Name: pkgscriptbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkgscriptbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptbeforetrigger();


--
-- Name: pkguiformaftertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkguiformaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaftertrigger();


--
-- Name: pkguiformaltertrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkguiformaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaltertrigger();


--
-- Name: pkguiformbeforetrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER pkguiformbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformbeforetrigger();


--
-- Name: teheadtrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER teheadtrigger AFTER INSERT OR UPDATE ON tehead FOR EACH ROW EXECUTE PROCEDURE triggertehead();


--
-- Name: teitemtrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER teitemtrigger AFTER INSERT OR UPDATE ON teitem FOR EACH ROW EXECUTE PROCEDURE triggerteitem();


--
-- Name: teprjtrigger; Type: TRIGGER; Schema: te; Owner: admin
--

CREATE TRIGGER teprjtrigger AFTER INSERT OR UPDATE ON teprj FOR EACH ROW EXECUTE PROCEDURE triggerteprj();



--
-- Name: pkgcmdaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaftertrigger();


--
-- Name: pkgcmdaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdaltertrigger();


--
-- Name: pkgcmdargaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdargaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaftertrigger();


--
-- Name: pkgcmdargaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdargaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargaltertrigger();


--
-- Name: pkgcmdargbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdargbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmdarg FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdargbeforetrigger();


--
-- Name: pkgcmdbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgcmdbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgcmd FOR EACH ROW EXECUTE PROCEDURE public._pkgcmdbeforetrigger();


--
-- Name: pkgimageaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgimageaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimageaftertrigger();


--
-- Name: pkgimagealtertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgimagealtertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagealtertrigger();


--
-- Name: pkgimagebeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgimagebeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgimage FOR EACH ROW EXECUTE PROCEDURE public._pkgimagebeforetrigger();


--
-- Name: pkgmetasqlaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgmetasqlaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaftertrigger();


--
-- Name: pkgmetasqlaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgmetasqlaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlaltertrigger();


--
-- Name: pkgmetasqlbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgmetasqlbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgmetasql FOR EACH ROW EXECUTE PROCEDURE public._pkgmetasqlbeforetrigger();


--
-- Name: pkgprivaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgprivaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaftertrigger();


--
-- Name: pkgprivaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgprivaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivaltertrigger();


--
-- Name: pkgprivbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgprivbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgpriv FOR EACH ROW EXECUTE PROCEDURE public._pkgprivbeforetrigger();


--
-- Name: pkgreportaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgreportaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaftertrigger();


--
-- Name: pkgreportaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgreportaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportaltertrigger();


--
-- Name: pkgreportbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgreportbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgreport FOR EACH ROW EXECUTE PROCEDURE public._pkgreportbeforetrigger();


--
-- Name: pkgscriptaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgscriptaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaftertrigger();


--
-- Name: pkgscriptaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgscriptaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptaltertrigger();


--
-- Name: pkgscriptbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkgscriptbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkgscript FOR EACH ROW EXECUTE PROCEDURE public._pkgscriptbeforetrigger();


--
-- Name: pkguiformaftertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkguiformaftertrigger AFTER INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaftertrigger();


--
-- Name: pkguiformaltertrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkguiformaltertrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformaltertrigger();


--
-- Name: pkguiformbeforetrigger; Type: TRIGGER; Schema: xtdesktop; Owner: admin
--

CREATE TRIGGER pkguiformbeforetrigger BEFORE INSERT OR DELETE OR UPDATE ON pkguiform FOR EACH ROW EXECUTE PROCEDURE public._pkguiformbeforetrigger();



--
-- Name: pkgcmdarg_cmdarg_cmd_id_fkey; Type: FK CONSTRAINT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkgcmdarg
    ADD CONSTRAINT pkgcmdarg_cmdarg_cmd_id_fkey FOREIGN KEY (cmdarg_cmd_id) REFERENCES pkgcmd(cmd_id);



--
-- Name: accnt_accnt_company_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY accnt
    ADD CONSTRAINT accnt_accnt_company_fkey FOREIGN KEY (accnt_company) REFERENCES company(company_number) ON UPDATE CASCADE;


--
-- Name: accnt_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY accnt
    ADD CONSTRAINT accnt_to_curr_symbol FOREIGN KEY (accnt_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: apapply_apapply_checkhead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apapply
    ADD CONSTRAINT apapply_apapply_checkhead_id_fkey FOREIGN KEY (apapply_checkhead_id) REFERENCES checkhead(checkhead_id);


--
-- Name: apapply_apapply_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apapply
    ADD CONSTRAINT apapply_apapply_vend_id_fkey FOREIGN KEY (apapply_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: apapply_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apapply
    ADD CONSTRAINT apapply_to_curr_symbol FOREIGN KEY (apapply_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: apcreditapply_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apcreditapply
    ADD CONSTRAINT apcreditapply_curr_symbol FOREIGN KEY (apcreditapply_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: apopen_apopen_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopen
    ADD CONSTRAINT apopen_apopen_vend_id_fkey FOREIGN KEY (apopen_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: apopen_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopen
    ADD CONSTRAINT apopen_to_curr_symbol FOREIGN KEY (apopen_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: apopentax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax
    ADD CONSTRAINT apopentax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: apopentax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax
    ADD CONSTRAINT apopentax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES apopen(apopen_id) ON DELETE CASCADE;


--
-- Name: apopentax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax
    ADD CONSTRAINT apopentax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: apopentax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax
    ADD CONSTRAINT apopentax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: apselect_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apselect
    ADD CONSTRAINT apselect_to_curr_symbol FOREIGN KEY (apselect_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: arapply_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY arapply
    ADD CONSTRAINT arapply_to_curr_symbol FOREIGN KEY (arapply_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: arcreditapply_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY arcreditapply
    ADD CONSTRAINT arcreditapply_curr_symbol FOREIGN KEY (arcreditapply_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: aropen_aropen_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropen
    ADD CONSTRAINT aropen_aropen_cust_id_fkey FOREIGN KEY (aropen_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: aropen_aropen_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropen
    ADD CONSTRAINT aropen_aropen_salesrep_id_fkey FOREIGN KEY (aropen_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: aropen_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropen
    ADD CONSTRAINT aropen_to_curr_symbol FOREIGN KEY (aropen_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: aropentax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax
    ADD CONSTRAINT aropentax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: aropentax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax
    ADD CONSTRAINT aropentax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES aropen(aropen_id) ON DELETE CASCADE;


--
-- Name: aropentax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax
    ADD CONSTRAINT aropentax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: aropentax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax
    ADD CONSTRAINT aropentax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: asohist_asohist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohist
    ADD CONSTRAINT asohist_asohist_taxtype_id_fkey FOREIGN KEY (asohist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: asohist_asohist_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohist
    ADD CONSTRAINT asohist_asohist_taxzone_id_fkey FOREIGN KEY (asohist_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: asohist_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohist
    ADD CONSTRAINT asohist_to_curr_symbol FOREIGN KEY (asohist_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: asohisttax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax
    ADD CONSTRAINT asohisttax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: asohisttax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax
    ADD CONSTRAINT asohisttax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES asohist(asohist_id) ON DELETE CASCADE;


--
-- Name: asohisttax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax
    ADD CONSTRAINT asohisttax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: asohisttax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax
    ADD CONSTRAINT asohisttax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: bankaccnt_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankaccnt
    ADD CONSTRAINT bankaccnt_to_curr_symbol FOREIGN KEY (bankaccnt_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: bankadj_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankadj
    ADD CONSTRAINT bankadj_to_curr_symbol FOREIGN KEY (bankadj_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: bomhead_bomhead_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomhead
    ADD CONSTRAINT bomhead_bomhead_item_id_fkey FOREIGN KEY (bomhead_item_id) REFERENCES item(item_id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: bomitem_bomitem_char_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitem
    ADD CONSTRAINT bomitem_bomitem_char_id_fkey FOREIGN KEY (bomitem_char_id) REFERENCES "char"(char_id);


--
-- Name: bomitem_bomitem_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitem
    ADD CONSTRAINT bomitem_bomitem_item_id_fkey FOREIGN KEY (bomitem_item_id) REFERENCES item(item_id);


--
-- Name: bomitem_bomitem_parent_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitem
    ADD CONSTRAINT bomitem_bomitem_parent_item_id_fkey FOREIGN KEY (bomitem_parent_item_id) REFERENCES item(item_id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: bomitem_bomitem_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitem
    ADD CONSTRAINT bomitem_bomitem_uom_id_fkey FOREIGN KEY (bomitem_uom_id) REFERENCES uom(uom_id);


--
-- Name: bomitemcost_bomitemcost_bomitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemcost
    ADD CONSTRAINT bomitemcost_bomitemcost_bomitem_id_fkey FOREIGN KEY (bomitemcost_bomitem_id) REFERENCES bomitem(bomitem_id);


--
-- Name: bomitemcost_bomitemcost_costelem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemcost
    ADD CONSTRAINT bomitemcost_bomitemcost_costelem_id_fkey FOREIGN KEY (bomitemcost_costelem_id) REFERENCES costelem(costelem_id);


--
-- Name: bomitemcost_bomitemcost_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemcost
    ADD CONSTRAINT bomitemcost_bomitemcost_curr_id_fkey FOREIGN KEY (bomitemcost_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: bomitemsub_bomitemsub_bomitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemsub
    ADD CONSTRAINT bomitemsub_bomitemsub_bomitem_id_fkey FOREIGN KEY (bomitemsub_bomitem_id) REFERENCES bomitem(bomitem_id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: bomitemsub_bomitemsub_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemsub
    ADD CONSTRAINT bomitemsub_bomitemsub_item_id_fkey FOREIGN KEY (bomitemsub_item_id) REFERENCES item(item_id) ON UPDATE RESTRICT ON DELETE CASCADE;


--
-- Name: bomwork_bomwork_char_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomwork
    ADD CONSTRAINT bomwork_bomwork_char_id_fkey FOREIGN KEY (bomwork_char_id) REFERENCES "char"(char_id);


--
-- Name: budgitem_budgitem_budghead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budgitem
    ADD CONSTRAINT budgitem_budgitem_budghead_id_fkey FOREIGN KEY (budgitem_budghead_id) REFERENCES budghead(budghead_id);


--
-- Name: budgitem_budgitem_period_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budgitem
    ADD CONSTRAINT budgitem_budgitem_period_id_fkey FOREIGN KEY (budgitem_period_id) REFERENCES period(period_id);


--
-- Name: cashrcpt_bankaccnt_bankaccnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcpt
    ADD CONSTRAINT cashrcpt_bankaccnt_bankaccnt_id_fkey FOREIGN KEY (cashrcpt_bankaccnt_id) REFERENCES bankaccnt(bankaccnt_id);


--
-- Name: cashrcpt_cust_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcpt
    ADD CONSTRAINT cashrcpt_cust_cust_id_fkey FOREIGN KEY (cashrcpt_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: cashrcpt_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcpt
    ADD CONSTRAINT cashrcpt_to_curr_symbol FOREIGN KEY (cashrcpt_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cashrcptitem_aropen_aropen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptitem
    ADD CONSTRAINT cashrcptitem_aropen_aropen_id_fkey FOREIGN KEY (cashrcptitem_aropen_id) REFERENCES aropen(aropen_id);


--
-- Name: cashrcptitem_cashrcpt_cashrcpt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptitem
    ADD CONSTRAINT cashrcptitem_cashrcpt_cashrcpt_id_fkey FOREIGN KEY (cashrcptitem_cashrcpt_id) REFERENCES cashrcpt(cashrcpt_id);


--
-- Name: cashrcptmisc_accnt_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptmisc
    ADD CONSTRAINT cashrcptmisc_accnt_accnt_id_fkey FOREIGN KEY (cashrcptmisc_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: cashrcptmisc_cashrcpt_cashrcpt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptmisc
    ADD CONSTRAINT cashrcptmisc_cashrcpt_cashrcpt_id_fkey FOREIGN KEY (cashrcptmisc_cashrcpt_id) REFERENCES cashrcpt(cashrcpt_id);


--
-- Name: ccard_ccard_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccard
    ADD CONSTRAINT ccard_ccard_cust_id_fkey FOREIGN KEY (ccard_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: ccbank_ccbank_bankaccnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccbank
    ADD CONSTRAINT ccbank_ccbank_bankaccnt_id_fkey FOREIGN KEY (ccbank_bankaccnt_id) REFERENCES bankaccnt(bankaccnt_id);


--
-- Name: charopt_charopt_char_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charopt
    ADD CONSTRAINT charopt_charopt_char_id_fkey FOREIGN KEY (charopt_char_id) REFERENCES "char"(char_id) ON DELETE CASCADE;


--
-- Name: charuse_charuse_char_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charuse
    ADD CONSTRAINT charuse_charuse_char_id_fkey FOREIGN KEY (charuse_char_id) REFERENCES "char"(char_id) ON DELETE CASCADE;


--
-- Name: checkhead_checkhead_bankaccnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkhead
    ADD CONSTRAINT checkhead_checkhead_bankaccnt_id_fkey FOREIGN KEY (checkhead_bankaccnt_id) REFERENCES bankaccnt(bankaccnt_id);


--
-- Name: checkhead_checkhead_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkhead
    ADD CONSTRAINT checkhead_checkhead_curr_id_fkey FOREIGN KEY (checkhead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: checkhead_checkhead_expcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkhead
    ADD CONSTRAINT checkhead_checkhead_expcat_id_fkey FOREIGN KEY (checkhead_expcat_id) REFERENCES expcat(expcat_id);


--
-- Name: checkitem_checkitem_apopen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem
    ADD CONSTRAINT checkitem_checkitem_apopen_id_fkey FOREIGN KEY (checkitem_apopen_id) REFERENCES apopen(apopen_id);


--
-- Name: checkitem_checkitem_aropen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem
    ADD CONSTRAINT checkitem_checkitem_aropen_id_fkey FOREIGN KEY (checkitem_aropen_id) REFERENCES aropen(aropen_id);


--
-- Name: checkitem_checkitem_checkhead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem
    ADD CONSTRAINT checkitem_checkitem_checkhead_id_fkey FOREIGN KEY (checkitem_checkhead_id) REFERENCES checkhead(checkhead_id);


--
-- Name: checkitem_checkitem_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem
    ADD CONSTRAINT checkitem_checkitem_curr_id_fkey FOREIGN KEY (checkitem_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cmdarg_cmdarg_cmd_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmdarg
    ADD CONSTRAINT cmdarg_cmdarg_cmd_id_fkey FOREIGN KEY (cmdarg_cmd_id) REFERENCES cmd(cmd_id) ON DELETE CASCADE;


--
-- Name: cmhead_cmhead_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_cust_id_fkey FOREIGN KEY (cmhead_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: cmhead_cmhead_freighttaxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_freighttaxtype_id_fkey FOREIGN KEY (cmhead_freighttaxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cmhead_cmhead_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_prj_id_fkey FOREIGN KEY (cmhead_prj_id) REFERENCES prj(prj_id);


--
-- Name: cmhead_cmhead_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_salesrep_id_fkey FOREIGN KEY (cmhead_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: cmhead_cmhead_saletype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_saletype_id_fkey FOREIGN KEY (cmhead_saletype_id) REFERENCES saletype(saletype_id);


--
-- Name: cmhead_cmhead_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_shipzone_id_fkey FOREIGN KEY (cmhead_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: cmhead_cmhead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_cmhead_taxzone_id_fkey FOREIGN KEY (cmhead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: cmhead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmhead
    ADD CONSTRAINT cmhead_to_curr_symbol FOREIGN KEY (cmhead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cmheadtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax
    ADD CONSTRAINT cmheadtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: cmheadtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax
    ADD CONSTRAINT cmheadtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES cmhead(cmhead_id) ON DELETE CASCADE;


--
-- Name: cmheadtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax
    ADD CONSTRAINT cmheadtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: cmheadtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax
    ADD CONSTRAINT cmheadtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cmitem_cmhead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_cmhead_id_fkey FOREIGN KEY (cmitem_cmhead_id) REFERENCES cmhead(cmhead_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cmitem_cmitem_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_cmitem_price_uom_id_fkey FOREIGN KEY (cmitem_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: cmitem_cmitem_qty_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_cmitem_qty_uom_id_fkey FOREIGN KEY (cmitem_qty_uom_id) REFERENCES uom(uom_id);


--
-- Name: cmitem_cmitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitem
    ADD CONSTRAINT cmitem_cmitem_taxtype_id_fkey FOREIGN KEY (cmitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cmitemtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax
    ADD CONSTRAINT cmitemtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: cmitemtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax
    ADD CONSTRAINT cmitemtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES cmitem(cmitem_id) ON DELETE CASCADE;


--
-- Name: cmitemtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax
    ADD CONSTRAINT cmitemtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: cmitemtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax
    ADD CONSTRAINT cmitemtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cmnttypesource_cmnttypesource_cmnttype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttypesource
    ADD CONSTRAINT cmnttypesource_cmnttypesource_cmnttype_id_fkey FOREIGN KEY (cmnttypesource_cmnttype_id) REFERENCES cmnttype(cmnttype_id);


--
-- Name: cmnttypesource_cmnttypesource_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttypesource
    ADD CONSTRAINT cmnttypesource_cmnttypesource_source_id_fkey FOREIGN KEY (cmnttypesource_source_id) REFERENCES source(source_id);


--
-- Name: cntct_cntct_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntct
    ADD CONSTRAINT cntct_cntct_addr_id_fkey FOREIGN KEY (cntct_addr_id) REFERENCES addr(addr_id);


--
-- Name: cntct_cntct_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntct
    ADD CONSTRAINT cntct_cntct_crmacct_id_fkey FOREIGN KEY (cntct_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: cntctaddr_cntctaddr_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctaddr
    ADD CONSTRAINT cntctaddr_cntctaddr_addr_id_fkey FOREIGN KEY (cntctaddr_addr_id) REFERENCES addr(addr_id);


--
-- Name: cntctaddr_cntctaddr_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctaddr
    ADD CONSTRAINT cntctaddr_cntctaddr_cntct_id_fkey FOREIGN KEY (cntctaddr_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: cntctdata_cntctdata_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctdata
    ADD CONSTRAINT cntctdata_cntctdata_cntct_id_fkey FOREIGN KEY (cntctdata_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: cntcteml_cntcteml_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntcteml
    ADD CONSTRAINT cntcteml_cntcteml_cntct_id_fkey FOREIGN KEY (cntcteml_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: cntctmrgd_cntctmrgd_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctmrgd
    ADD CONSTRAINT cntctmrgd_cntctmrgd_cntct_id_fkey FOREIGN KEY (cntctmrgd_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: cntctsel_cntctsel_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctsel
    ADD CONSTRAINT cntctsel_cntctsel_cntct_id_fkey FOREIGN KEY (cntctsel_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: cobill_cobill_invcitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobill
    ADD CONSTRAINT cobill_cobill_invcitem_id_fkey FOREIGN KEY (cobill_invcitem_id) REFERENCES invcitem(invcitem_id);


--
-- Name: cobill_cobill_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobill
    ADD CONSTRAINT cobill_cobill_taxtype_id_fkey FOREIGN KEY (cobill_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cobilltax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax
    ADD CONSTRAINT cobilltax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: cobilltax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax
    ADD CONSTRAINT cobilltax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES cobill(cobill_id) ON DELETE CASCADE;


--
-- Name: cobilltax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax
    ADD CONSTRAINT cobilltax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: cobilltax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax
    ADD CONSTRAINT cobilltax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cobmisc_cobmisc_invchead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisc
    ADD CONSTRAINT cobmisc_cobmisc_invchead_id_fkey FOREIGN KEY (cobmisc_invchead_id) REFERENCES invchead(invchead_id);


--
-- Name: cobmisc_cobmisc_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisc
    ADD CONSTRAINT cobmisc_cobmisc_taxtype_id_fkey FOREIGN KEY (cobmisc_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cobmisc_cobmisc_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisc
    ADD CONSTRAINT cobmisc_cobmisc_taxzone_id_fkey FOREIGN KEY (cobmisc_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: cobmisc_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisc
    ADD CONSTRAINT cobmisc_to_curr_symbol FOREIGN KEY (cobmisc_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cobmisctax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax
    ADD CONSTRAINT cobmisctax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: cobmisctax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax
    ADD CONSTRAINT cobmisctax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES cobmisc(cobmisc_id) ON DELETE CASCADE;


--
-- Name: cobmisctax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax
    ADD CONSTRAINT cobmisctax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: cobmisctax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax
    ADD CONSTRAINT cobmisctax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cohead_cohead_billto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_billto_cntct_id_fkey FOREIGN KEY (cohead_billto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: cohead_cohead_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_cust_id_fkey FOREIGN KEY (cohead_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: cohead_cohead_misc_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_misc_accnt_id_fkey FOREIGN KEY (cohead_misc_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: cohead_cohead_ophead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_ophead_id_fkey FOREIGN KEY (cohead_ophead_id) REFERENCES ophead(ophead_id);


--
-- Name: cohead_cohead_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_prj_id_fkey FOREIGN KEY (cohead_prj_id) REFERENCES prj(prj_id);


--
-- Name: cohead_cohead_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_salesrep_id_fkey FOREIGN KEY (cohead_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: cohead_cohead_saletype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_saletype_id_fkey FOREIGN KEY (cohead_saletype_id) REFERENCES saletype(saletype_id);


--
-- Name: cohead_cohead_shipform_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_shipform_id_fkey FOREIGN KEY (cohead_shipform_id) REFERENCES shipform(shipform_id);


--
-- Name: cohead_cohead_shipto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_shipto_cntct_id_fkey FOREIGN KEY (cohead_shipto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: cohead_cohead_shipto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_shipto_id_fkey FOREIGN KEY (cohead_shipto_id) REFERENCES shiptoinfo(shipto_id);


--
-- Name: cohead_cohead_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_shipzone_id_fkey FOREIGN KEY (cohead_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: cohead_cohead_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_taxtype_id_fkey FOREIGN KEY (cohead_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cohead_cohead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_taxzone_id_fkey FOREIGN KEY (cohead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: cohead_cohead_terms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_terms_id_fkey FOREIGN KEY (cohead_terms_id) REFERENCES terms(terms_id);


--
-- Name: cohead_cohead_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_cohead_warehous_id_fkey FOREIGN KEY (cohead_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: cohead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohead
    ADD CONSTRAINT cohead_to_curr_symbol FOREIGN KEY (cohead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cohist_cohist_cohead_ccpay_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_cohist_cohead_ccpay_id_fkey FOREIGN KEY (cohist_cohead_ccpay_id) REFERENCES ccpay(ccpay_id);


--
-- Name: cohist_cohist_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_cohist_cust_id_fkey FOREIGN KEY (cohist_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: cohist_cohist_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_cohist_salesrep_id_fkey FOREIGN KEY (cohist_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: cohist_cohist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_cohist_taxtype_id_fkey FOREIGN KEY (cohist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: cohist_cohist_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_cohist_taxzone_id_fkey FOREIGN KEY (cohist_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: cohist_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohist
    ADD CONSTRAINT cohist_to_curr_symbol FOREIGN KEY (cohist_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cohisttax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax
    ADD CONSTRAINT cohisttax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: cohisttax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax
    ADD CONSTRAINT cohisttax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES cohist(cohist_id) ON DELETE CASCADE;


--
-- Name: cohisttax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax
    ADD CONSTRAINT cohisttax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: cohisttax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax
    ADD CONSTRAINT cohisttax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: coitem_coitem_cohead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_cohead_id_fkey FOREIGN KEY (coitem_cohead_id) REFERENCES cohead(cohead_id) ON DELETE CASCADE;


--
-- Name: coitem_coitem_cos_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_cos_accnt_id_fkey FOREIGN KEY (coitem_cos_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: coitem_coitem_itemsite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_itemsite_id_fkey FOREIGN KEY (coitem_itemsite_id) REFERENCES itemsite(itemsite_id);


--
-- Name: coitem_coitem_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_price_uom_id_fkey FOREIGN KEY (coitem_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: coitem_coitem_qty_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_qty_uom_id_fkey FOREIGN KEY (coitem_qty_uom_id) REFERENCES uom(uom_id);


--
-- Name: coitem_coitem_rev_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_rev_accnt_id_fkey FOREIGN KEY (coitem_rev_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: coitem_coitem_substitute_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_substitute_item_id_fkey FOREIGN KEY (coitem_substitute_item_id) REFERENCES item(item_id);


--
-- Name: coitem_coitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY coitem
    ADD CONSTRAINT coitem_coitem_taxtype_id_fkey FOREIGN KEY (coitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: comment_comment_cmnttype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY comment
    ADD CONSTRAINT comment_comment_cmnttype_id_fkey FOREIGN KEY (comment_cmnttype_id) REFERENCES cmnttype(cmnttype_id);


--
-- Name: company_company_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_curr_id_fkey FOREIGN KEY (company_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: company_company_dscrp_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_dscrp_accnt_id_fkey FOREIGN KEY (company_dscrp_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: company_company_gainloss_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_gainloss_accnt_id_fkey FOREIGN KEY (company_gainloss_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: company_company_unrlzgainloss_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_unrlzgainloss_accnt_id_fkey FOREIGN KEY (company_unrlzgainloss_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: company_company_yearend_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company
    ADD CONSTRAINT company_company_yearend_accnt_id_fkey FOREIGN KEY (company_yearend_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: contrct_contrct_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY contrct
    ADD CONSTRAINT contrct_contrct_vend_id_fkey FOREIGN KEY (contrct_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: costhist_new_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY costhist
    ADD CONSTRAINT costhist_new_to_curr_symbol FOREIGN KEY (costhist_newcurr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: costhist_old_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY costhist
    ADD CONSTRAINT costhist_old_to_curr_symbol FOREIGN KEY (costhist_oldcurr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: crmacct_crmacct_cntct_id_1_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_cntct_id_1_fkey FOREIGN KEY (crmacct_cntct_id_1) REFERENCES cntct(cntct_id);


--
-- Name: crmacct_crmacct_cntct_id_2_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_cntct_id_2_fkey FOREIGN KEY (crmacct_cntct_id_2) REFERENCES cntct(cntct_id);


--
-- Name: crmacct_crmacct_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_cust_id_fkey FOREIGN KEY (crmacct_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: crmacct_crmacct_emp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_emp_id_fkey FOREIGN KEY (crmacct_emp_id) REFERENCES emp(emp_id);


--
-- Name: crmacct_crmacct_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_parent_id_fkey FOREIGN KEY (crmacct_parent_id) REFERENCES crmacct(crmacct_id);


--
-- Name: crmacct_crmacct_prospect_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_prospect_id_fkey FOREIGN KEY (crmacct_prospect_id) REFERENCES prospect(prospect_id);


--
-- Name: crmacct_crmacct_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_salesrep_id_fkey FOREIGN KEY (crmacct_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: crmacct_crmacct_taxauth_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_taxauth_id_fkey FOREIGN KEY (crmacct_taxauth_id) REFERENCES taxauth(taxauth_id);


--
-- Name: crmacct_crmacct_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct
    ADD CONSTRAINT crmacct_crmacct_vend_id_fkey FOREIGN KEY (crmacct_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: crmacctsel_crmacctsel_dest_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacctsel
    ADD CONSTRAINT crmacctsel_crmacctsel_dest_crmacct_id_fkey FOREIGN KEY (crmacctsel_dest_crmacct_id) REFERENCES crmacct(crmacct_id) ON DELETE CASCADE;


--
-- Name: crmacctsel_crmacctsel_src_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacctsel
    ADD CONSTRAINT crmacctsel_crmacctsel_src_crmacct_id_fkey FOREIGN KEY (crmacctsel_src_crmacct_id) REFERENCES crmacct(crmacct_id) ON DELETE CASCADE;


--
-- Name: curr_rate_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY curr_rate
    ADD CONSTRAINT curr_rate_to_curr_symbol FOREIGN KEY (curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cust_creditlmt_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT cust_creditlmt_to_curr_symbol FOREIGN KEY (cust_creditlmt_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: cust_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT cust_to_curr_symbol FOREIGN KEY (cust_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: custinfo_cust_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_cntct_id_fkey FOREIGN KEY (cust_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: custinfo_cust_corrcntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_corrcntct_id_fkey FOREIGN KEY (cust_corrcntct_id) REFERENCES cntct(cntct_id);


--
-- Name: custinfo_cust_custtype_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_custtype_fkey FOREIGN KEY (cust_custtype_id) REFERENCES custtype(custtype_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: custinfo_cust_salesrep_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_salesrep_fkey FOREIGN KEY (cust_salesrep_id) REFERENCES salesrep(salesrep_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: custinfo_cust_shipform_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_shipform_fkey FOREIGN KEY (cust_shipform_id) REFERENCES shipform(shipform_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: custinfo_cust_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_taxzone_id_fkey FOREIGN KEY (cust_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: custinfo_cust_terms_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY custinfo
    ADD CONSTRAINT custinfo_cust_terms_fkey FOREIGN KEY (cust_terms_id) REFERENCES terms(terms_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: emp_emp_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_cntct_id_fkey FOREIGN KEY (emp_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: emp_emp_dept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_dept_id_fkey FOREIGN KEY (emp_dept_id) REFERENCES dept(dept_id);


--
-- Name: emp_emp_image_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_image_id_fkey FOREIGN KEY (emp_image_id) REFERENCES image(image_id);


--
-- Name: emp_emp_mgr_emp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_mgr_emp_id_fkey FOREIGN KEY (emp_mgr_emp_id) REFERENCES emp(emp_id);


--
-- Name: emp_emp_shift_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_shift_id_fkey FOREIGN KEY (emp_shift_id) REFERENCES shift(shift_id);


--
-- Name: emp_emp_wage_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_wage_curr_id_fkey FOREIGN KEY (emp_wage_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: emp_emp_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp
    ADD CONSTRAINT emp_emp_warehous_id_fkey FOREIGN KEY (emp_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: empgrpitem_empgrpitem_emp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrpitem
    ADD CONSTRAINT empgrpitem_empgrpitem_emp_id_fkey FOREIGN KEY (empgrpitem_emp_id) REFERENCES emp(emp_id);


--
-- Name: empgrpitem_empgrpitem_empgrp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrpitem
    ADD CONSTRAINT empgrpitem_empgrpitem_empgrp_id_fkey FOREIGN KEY (empgrpitem_empgrp_id) REFERENCES empgrp(empgrp_id);


--
-- Name: flnotes_flnotes_flhead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flnotes
    ADD CONSTRAINT flnotes_flnotes_flhead_id_fkey FOREIGN KEY (flnotes_flhead_id) REFERENCES flhead(flhead_id) ON DELETE CASCADE;


--
-- Name: flnotes_flnotes_period_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flnotes
    ADD CONSTRAINT flnotes_flnotes_period_id_fkey FOREIGN KEY (flnotes_period_id) REFERENCES period(period_id) ON DELETE CASCADE;


--
-- Name: grppriv_grppriv_grp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY grppriv
    ADD CONSTRAINT grppriv_grppriv_grp_id_fkey FOREIGN KEY (grppriv_grp_id) REFERENCES grp(grp_id);


--
-- Name: incdt_incdt_aropen_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_aropen_id_fkey FOREIGN KEY (incdt_aropen_id) REFERENCES aropen(aropen_id);


--
-- Name: incdt_incdt_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_cntct_id_fkey FOREIGN KEY (incdt_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: incdt_incdt_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_crmacct_id_fkey FOREIGN KEY (incdt_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: incdt_incdt_incdtcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_incdtcat_id_fkey FOREIGN KEY (incdt_incdtcat_id) REFERENCES incdtcat(incdtcat_id);


--
-- Name: incdt_incdt_incdtpriority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_incdtpriority_id_fkey FOREIGN KEY (incdt_incdtpriority_id) REFERENCES incdtpriority(incdtpriority_id);


--
-- Name: incdt_incdt_incdtresolution_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_incdtresolution_id_fkey FOREIGN KEY (incdt_incdtresolution_id) REFERENCES incdtresolution(incdtresolution_id);


--
-- Name: incdt_incdt_incdtseverity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_incdtseverity_id_fkey FOREIGN KEY (incdt_incdtseverity_id) REFERENCES incdtseverity(incdtseverity_id);


--
-- Name: incdt_incdt_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_item_id_fkey FOREIGN KEY (incdt_item_id) REFERENCES item(item_id);


--
-- Name: incdt_incdt_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_prj_id_fkey FOREIGN KEY (incdt_prj_id) REFERENCES prj(prj_id);


--
-- Name: incdt_incdt_recurring_incdt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt
    ADD CONSTRAINT incdt_incdt_recurring_incdt_id_fkey FOREIGN KEY (incdt_recurring_incdt_id) REFERENCES incdt(incdt_id);


--
-- Name: incdthist_incdthist_incdt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdthist
    ADD CONSTRAINT incdthist_incdthist_incdt_id_fkey FOREIGN KEY (incdthist_incdt_id) REFERENCES incdt(incdt_id);


--
-- Name: invbal_invbal_itemsite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invbal
    ADD CONSTRAINT invbal_invbal_itemsite_id_fkey FOREIGN KEY (invbal_itemsite_id) REFERENCES itemsite(itemsite_id) ON DELETE CASCADE;


--
-- Name: invbal_invbal_period_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invbal
    ADD CONSTRAINT invbal_invbal_period_id_fkey FOREIGN KEY (invbal_period_id) REFERENCES period(period_id) ON DELETE CASCADE;


--
-- Name: invchead_invchead_saletype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_invchead_saletype_id_fkey FOREIGN KEY (invchead_saletype_id) REFERENCES saletype(saletype_id);


--
-- Name: invchead_invchead_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_invchead_shipzone_id_fkey FOREIGN KEY (invchead_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: invchead_invchead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_invchead_taxzone_id_fkey FOREIGN KEY (invchead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: invchead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead
    ADD CONSTRAINT invchead_to_curr_symbol FOREIGN KEY (invchead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: invcheadtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax
    ADD CONSTRAINT invcheadtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: invcheadtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax
    ADD CONSTRAINT invcheadtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES invchead(invchead_id) ON DELETE CASCADE;


--
-- Name: invcheadtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax
    ADD CONSTRAINT invcheadtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: invcheadtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax
    ADD CONSTRAINT invcheadtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: invcitem_invchead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invchead_id_fkey FOREIGN KEY (invcitem_invchead_id) REFERENCES invchead(invchead_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: invcitem_invcitem_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invcitem_price_uom_id_fkey FOREIGN KEY (invcitem_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: invcitem_invcitem_qty_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invcitem_qty_uom_id_fkey FOREIGN KEY (invcitem_qty_uom_id) REFERENCES uom(uom_id);


--
-- Name: invcitem_invcitem_rev_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invcitem_rev_accnt_id_fkey FOREIGN KEY (invcitem_rev_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: invcitem_invcitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem
    ADD CONSTRAINT invcitem_invcitem_taxtype_id_fkey FOREIGN KEY (invcitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: invcitemtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax
    ADD CONSTRAINT invcitemtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: invcitemtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax
    ADD CONSTRAINT invcitemtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES invcitem(invcitem_id) ON DELETE CASCADE;


--
-- Name: invcitemtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax
    ADD CONSTRAINT invcitemtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: invcitemtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax
    ADD CONSTRAINT invcitemtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: invhistexpcat_invhistexpcat_expcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invhistexpcat
    ADD CONSTRAINT invhistexpcat_invhistexpcat_expcat_id_fkey FOREIGN KEY (invhistexpcat_expcat_id) REFERENCES expcat(expcat_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: invhistexpcat_invhistexpcat_invhist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invhistexpcat
    ADD CONSTRAINT invhistexpcat_invhistexpcat_invhist_id_fkey FOREIGN KEY (invhistexpcat_invhist_id) REFERENCES invhist(invhist_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: ipsass_ipsass_ipshead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsass
    ADD CONSTRAINT ipsass_ipsass_ipshead_id_fkey FOREIGN KEY (ipsass_ipshead_id) REFERENCES ipshead(ipshead_id);


--
-- Name: ipsfreight_ipsfreight_freightclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight
    ADD CONSTRAINT ipsfreight_ipsfreight_freightclass_id_fkey FOREIGN KEY (ipsfreight_freightclass_id) REFERENCES freightclass(freightclass_id);


--
-- Name: ipsfreight_ipsfreight_ipshead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight
    ADD CONSTRAINT ipsfreight_ipsfreight_ipshead_id_fkey FOREIGN KEY (ipsfreight_ipshead_id) REFERENCES ipshead(ipshead_id);


--
-- Name: ipsfreight_ipsfreight_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight
    ADD CONSTRAINT ipsfreight_ipsfreight_shipzone_id_fkey FOREIGN KEY (ipsfreight_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: ipsfreight_ipsfreight_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight
    ADD CONSTRAINT ipsfreight_ipsfreight_warehous_id_fkey FOREIGN KEY (ipsfreight_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: ipshead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipshead
    ADD CONSTRAINT ipshead_to_curr_symbol FOREIGN KEY (ipshead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: ipsitem_ipshead_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_ipshead_id_fk FOREIGN KEY (ipsitem_ipshead_id) REFERENCES ipshead(ipshead_id) ON DELETE CASCADE;


--
-- Name: ipsitem_ipsitem_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_ipsitem_price_uom_id_fkey FOREIGN KEY (ipsitem_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: ipsitem_ipsitem_qty_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_ipsitem_qty_uom_id_fkey FOREIGN KEY (ipsitem_qty_uom_id) REFERENCES uom(uom_id);


--
-- Name: ipsitem_ipsitem_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_ipsitem_warehous_id_fkey FOREIGN KEY (ipsitem_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: ipsitem_item_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsiteminfo
    ADD CONSTRAINT ipsitem_item_id_fk FOREIGN KEY (ipsitem_item_id) REFERENCES item(item_id);


--
-- Name: ipsitemchar_ipsitemchar_char_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsitemchar
    ADD CONSTRAINT ipsitemchar_ipsitemchar_char_id_fkey FOREIGN KEY (ipsitemchar_char_id) REFERENCES "char"(char_id);


--
-- Name: ipsitemchar_ipsitemchar_ipsitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsitemchar
    ADD CONSTRAINT ipsitemchar_ipsitemchar_ipsitem_id_fkey FOREIGN KEY (ipsitemchar_ipsitem_id) REFERENCES ipsiteminfo(ipsitem_id) ON DELETE CASCADE;


--
-- Name: item_item_classcode_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_item_classcode_id_fkey FOREIGN KEY (item_classcode_id) REFERENCES classcode(classcode_id);


--
-- Name: item_item_freightclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_item_freightclass_id_fkey FOREIGN KEY (item_freightclass_id) REFERENCES freightclass(freightclass_id);


--
-- Name: item_item_inv_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_item_inv_uom_id_fkey FOREIGN KEY (item_inv_uom_id) REFERENCES uom(uom_id);


--
-- Name: item_item_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_item_price_uom_id_fkey FOREIGN KEY (item_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: itemalias_itemalias_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemalias
    ADD CONSTRAINT itemalias_itemalias_crmacct_id_fkey FOREIGN KEY (itemalias_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: itemalias_itemalias_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemalias
    ADD CONSTRAINT itemalias_itemalias_item_id_fkey FOREIGN KEY (itemalias_item_id) REFERENCES item(item_id);


--
-- Name: itemcost_itemcost_costelem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemcost
    ADD CONSTRAINT itemcost_itemcost_costelem_id_fkey FOREIGN KEY (itemcost_costelem_id) REFERENCES costelem(costelem_id);


--
-- Name: itemcost_itemcost_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemcost
    ADD CONSTRAINT itemcost_itemcost_curr_id_fkey FOREIGN KEY (itemcost_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: itemcost_itemcost_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemcost
    ADD CONSTRAINT itemcost_itemcost_item_id_fkey FOREIGN KEY (itemcost_item_id) REFERENCES item(item_id);


--
-- Name: itemcost_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemcost
    ADD CONSTRAINT itemcost_to_curr_symbol FOREIGN KEY (itemcost_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: itemsite_itemsite_costcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsite
    ADD CONSTRAINT itemsite_itemsite_costcat_id_fkey FOREIGN KEY (itemsite_costcat_id) REFERENCES costcat(costcat_id);


--
-- Name: itemsite_itemsite_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsite
    ADD CONSTRAINT itemsite_itemsite_item_id_fkey FOREIGN KEY (itemsite_item_id) REFERENCES item(item_id);


--
-- Name: itemsite_itemsite_plancode_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsite
    ADD CONSTRAINT itemsite_itemsite_plancode_id_fkey FOREIGN KEY (itemsite_plancode_id) REFERENCES plancode(plancode_id);


--
-- Name: itemsite_itemsite_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsite
    ADD CONSTRAINT itemsite_itemsite_warehous_id_fkey FOREIGN KEY (itemsite_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: itemsrc_itemsrc_contrct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsrc
    ADD CONSTRAINT itemsrc_itemsrc_contrct_id_fkey FOREIGN KEY (itemsrc_contrct_id) REFERENCES contrct(contrct_id);


--
-- Name: itemsrc_itemsrc_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsrc
    ADD CONSTRAINT itemsrc_itemsrc_item_id_fkey FOREIGN KEY (itemsrc_item_id) REFERENCES item(item_id) ON DELETE CASCADE;


--
-- Name: itemsrc_itemsrc_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsrc
    ADD CONSTRAINT itemsrc_itemsrc_vend_id_fkey FOREIGN KEY (itemsrc_vend_id) REFERENCES vendinfo(vend_id) ON DELETE CASCADE;


--
-- Name: itemsrcp_itemsrcp_itemsrc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsrcp
    ADD CONSTRAINT itemsrcp_itemsrcp_itemsrc_id_fkey FOREIGN KEY (itemsrcp_itemsrc_id) REFERENCES itemsrc(itemsrc_id) ON DELETE CASCADE;


--
-- Name: itemsrcp_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsrcp
    ADD CONSTRAINT itemsrcp_to_curr_symbol FOREIGN KEY (itemsrcp_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: itemsub_itemsub_parent_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsub
    ADD CONSTRAINT itemsub_itemsub_parent_item_id_fkey FOREIGN KEY (itemsub_parent_item_id) REFERENCES item(item_id);


--
-- Name: itemsub_itemsub_sub_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemsub
    ADD CONSTRAINT itemsub_itemsub_sub_item_id_fkey FOREIGN KEY (itemsub_sub_item_id) REFERENCES item(item_id);


--
-- Name: itemtax_itemtax_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtax
    ADD CONSTRAINT itemtax_itemtax_item_id_fkey FOREIGN KEY (itemtax_item_id) REFERENCES item(item_id);


--
-- Name: itemtax_itemtax_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtax
    ADD CONSTRAINT itemtax_itemtax_taxtype_id_fkey FOREIGN KEY (itemtax_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: itemtax_itemtax_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtax
    ADD CONSTRAINT itemtax_itemtax_taxzone_id_fkey FOREIGN KEY (itemtax_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: itemtrans_itemtrans_source_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtrans
    ADD CONSTRAINT itemtrans_itemtrans_source_item_id_fkey FOREIGN KEY (itemtrans_source_item_id) REFERENCES item(item_id);


--
-- Name: itemtrans_itemtrans_target_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtrans
    ADD CONSTRAINT itemtrans_itemtrans_target_item_id_fkey FOREIGN KEY (itemtrans_target_item_id) REFERENCES item(item_id);


--
-- Name: itemuom_itemuom_itemuomconv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuom
    ADD CONSTRAINT itemuom_itemuom_itemuomconv_id_fkey FOREIGN KEY (itemuom_itemuomconv_id) REFERENCES itemuomconv(itemuomconv_id);


--
-- Name: itemuom_itemuom_uomtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuom
    ADD CONSTRAINT itemuom_itemuom_uomtype_id_fkey FOREIGN KEY (itemuom_uomtype_id) REFERENCES uomtype(uomtype_id);


--
-- Name: itemuomconv_itemuomconv_from_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuomconv
    ADD CONSTRAINT itemuomconv_itemuomconv_from_uom_id_fkey FOREIGN KEY (itemuomconv_from_uom_id) REFERENCES uom(uom_id);


--
-- Name: itemuomconv_itemuomconv_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuomconv
    ADD CONSTRAINT itemuomconv_itemuomconv_item_id_fkey FOREIGN KEY (itemuomconv_item_id) REFERENCES item(item_id);


--
-- Name: itemuomconv_itemuomconv_to_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuomconv
    ADD CONSTRAINT itemuomconv_itemuomconv_to_uom_id_fkey FOREIGN KEY (itemuomconv_to_uom_id) REFERENCES uom(uom_id);


--
-- Name: mrghist_mrghist_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY mrghist
    ADD CONSTRAINT mrghist_mrghist_cntct_id_fkey FOREIGN KEY (mrghist_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: ophead_ophead_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_cntct_id_fkey FOREIGN KEY (ophead_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: ophead_ophead_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_crmacct_id_fkey FOREIGN KEY (ophead_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: ophead_ophead_opsource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_opsource_id_fkey FOREIGN KEY (ophead_opsource_id) REFERENCES opsource(opsource_id);


--
-- Name: ophead_ophead_opstage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_opstage_id_fkey FOREIGN KEY (ophead_opstage_id) REFERENCES opstage(opstage_id);


--
-- Name: ophead_ophead_optype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_optype_id_fkey FOREIGN KEY (ophead_optype_id) REFERENCES optype(optype_id);


--
-- Name: ophead_ophead_priority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead
    ADD CONSTRAINT ophead_ophead_priority_id_fkey FOREIGN KEY (ophead_priority_id) REFERENCES incdtpriority(incdtpriority_id);


--
-- Name: pack_pack_shiphead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pack
    ADD CONSTRAINT pack_pack_shiphead_id_fkey FOREIGN KEY (pack_shiphead_id) REFERENCES shiphead(shiphead_id);


--
-- Name: payco_payco_ccpay_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY payco
    ADD CONSTRAINT payco_payco_ccpay_id_fkey FOREIGN KEY (payco_ccpay_id) REFERENCES ccpay(ccpay_id);


--
-- Name: payco_payco_cohead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY payco
    ADD CONSTRAINT payco_payco_cohead_id_fkey FOREIGN KEY (payco_cohead_id) REFERENCES cohead(cohead_id);


--
-- Name: pkgdep_pkgdep_parent_pkghead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgdep
    ADD CONSTRAINT pkgdep_pkgdep_parent_pkghead_id_fkey FOREIGN KEY (pkgdep_parent_pkghead_id) REFERENCES pkghead(pkghead_id);


--
-- Name: pkgdep_pkgdep_pkghead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgdep
    ADD CONSTRAINT pkgdep_pkgdep_pkghead_id_fkey FOREIGN KEY (pkgdep_pkghead_id) REFERENCES pkghead(pkghead_id);


--
-- Name: pkgitem_pkgitem_pkghead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgitem
    ADD CONSTRAINT pkgitem_pkgitem_pkghead_id_fkey FOREIGN KEY (pkgitem_pkghead_id) REFERENCES pkghead(pkghead_id) ON DELETE CASCADE;


--
-- Name: pohead_pohead_cohead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_cohead_id_fkey FOREIGN KEY (pohead_cohead_id) REFERENCES cohead(cohead_id) ON DELETE SET NULL;


--
-- Name: pohead_pohead_shipto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_shipto_cntct_id_fkey FOREIGN KEY (pohead_shipto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: pohead_pohead_shiptoddress_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_shiptoddress_id_fkey FOREIGN KEY (pohead_shiptoaddress_id) REFERENCES addr(addr_id);


--
-- Name: pohead_pohead_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_taxtype_id_fkey FOREIGN KEY (pohead_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: pohead_pohead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_taxzone_id_fkey FOREIGN KEY (pohead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: pohead_pohead_terms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_terms_id_fkey FOREIGN KEY (pohead_terms_id) REFERENCES terms(terms_id);


--
-- Name: pohead_pohead_vend_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_vend_cntct_id_fkey FOREIGN KEY (pohead_vend_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: pohead_pohead_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_vend_id_fkey FOREIGN KEY (pohead_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: pohead_pohead_vendaddr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_vendaddr_id_fkey FOREIGN KEY (pohead_vendaddr_id) REFERENCES vendaddrinfo(vendaddr_id);


--
-- Name: pohead_pohead_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_pohead_warehous_id_fkey FOREIGN KEY (pohead_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: pohead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pohead
    ADD CONSTRAINT pohead_to_curr_symbol FOREIGN KEY (pohead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: poitem_poitem_expcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_expcat_id_fkey FOREIGN KEY (poitem_expcat_id) REFERENCES expcat(expcat_id);


--
-- Name: poitem_poitem_itemsite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_itemsite_id_fkey FOREIGN KEY (poitem_itemsite_id) REFERENCES itemsite(itemsite_id);


--
-- Name: poitem_poitem_itemsrc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_itemsrc_id_fkey FOREIGN KEY (poitem_itemsrc_id) REFERENCES itemsrc(itemsrc_id);


--
-- Name: poitem_poitem_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_prj_id_fkey FOREIGN KEY (poitem_prj_id) REFERENCES prj(prj_id);


--
-- Name: poitem_poitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poitem
    ADD CONSTRAINT poitem_poitem_taxtype_id_fkey FOREIGN KEY (poitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: poreject_poreject_recv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poreject
    ADD CONSTRAINT poreject_poreject_recv_id_fkey FOREIGN KEY (poreject_recv_id) REFERENCES recv(recv_id);


--
-- Name: poreject_poreject_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY poreject
    ADD CONSTRAINT poreject_poreject_vend_id_fkey FOREIGN KEY (poreject_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: prj_prj_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_prj_cntct_id_fkey FOREIGN KEY (prj_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: prj_prj_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_prj_crmacct_id_fkey FOREIGN KEY (prj_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: prj_prj_prjtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_prj_prjtype_id_fkey FOREIGN KEY (prj_prjtype_id) REFERENCES prjtype(prjtype_id);


--
-- Name: prj_prj_recurring_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj
    ADD CONSTRAINT prj_prj_recurring_prj_id_fkey FOREIGN KEY (prj_recurring_prj_id) REFERENCES prj(prj_id);


--
-- Name: prjtask_prjtask_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtask
    ADD CONSTRAINT prjtask_prjtask_prj_id_fkey FOREIGN KEY (prjtask_prj_id) REFERENCES prj(prj_id);


--
-- Name: prospect_prospect_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_prospect_cntct_id_fkey FOREIGN KEY (prospect_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: prospect_prospect_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_prospect_salesrep_id_fkey FOREIGN KEY (prospect_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: prospect_prospect_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_prospect_taxzone_id_fkey FOREIGN KEY (prospect_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: prospect_prospect_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prospect
    ADD CONSTRAINT prospect_prospect_warehous_id_fkey FOREIGN KEY (prospect_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: qryitem_qryitem_qryhead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY qryitem
    ADD CONSTRAINT qryitem_qryitem_qryhead_id_fkey FOREIGN KEY (qryitem_qryhead_id) REFERENCES qryhead(qryhead_id);


--
-- Name: quhead_quhead_billto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_billto_cntct_id_fkey FOREIGN KEY (quhead_billto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: quhead_quhead_misc_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_misc_accnt_id_fkey FOREIGN KEY (quhead_misc_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: quhead_quhead_ophead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_ophead_id_fkey FOREIGN KEY (quhead_ophead_id) REFERENCES ophead(ophead_id);


--
-- Name: quhead_quhead_prj_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_prj_id_fkey FOREIGN KEY (quhead_prj_id) REFERENCES prj(prj_id);


--
-- Name: quhead_quhead_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_salesrep_id_fkey FOREIGN KEY (quhead_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: quhead_quhead_saletype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_saletype_id_fkey FOREIGN KEY (quhead_saletype_id) REFERENCES saletype(saletype_id);


--
-- Name: quhead_quhead_shipto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_shipto_cntct_id_fkey FOREIGN KEY (quhead_shipto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: quhead_quhead_shipto_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_shipto_id_fkey FOREIGN KEY (quhead_shipto_id) REFERENCES shiptoinfo(shipto_id);


--
-- Name: quhead_quhead_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_shipzone_id_fkey FOREIGN KEY (quhead_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: quhead_quhead_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_taxtype_id_fkey FOREIGN KEY (quhead_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: quhead_quhead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_taxzone_id_fkey FOREIGN KEY (quhead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: quhead_quhead_terms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_terms_id_fkey FOREIGN KEY (quhead_terms_id) REFERENCES terms(terms_id);


--
-- Name: quhead_quhead_warehous_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_quhead_warehous_id_fkey FOREIGN KEY (quhead_warehous_id) REFERENCES whsinfo(warehous_id);


--
-- Name: quhead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quhead
    ADD CONSTRAINT quhead_to_curr_symbol FOREIGN KEY (quhead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: quitem_quitem_itemsrc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quitem
    ADD CONSTRAINT quitem_quitem_itemsrc_id_fkey FOREIGN KEY (quitem_itemsrc_id) REFERENCES itemsrc(itemsrc_id);


--
-- Name: quitem_quitem_price_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quitem
    ADD CONSTRAINT quitem_quitem_price_uom_id_fkey FOREIGN KEY (quitem_price_uom_id) REFERENCES uom(uom_id);


--
-- Name: quitem_quitem_qty_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quitem
    ADD CONSTRAINT quitem_quitem_qty_uom_id_fkey FOREIGN KEY (quitem_qty_uom_id) REFERENCES uom(uom_id);


--
-- Name: quitem_quitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY quitem
    ADD CONSTRAINT quitem_quitem_taxtype_id_fkey FOREIGN KEY (quitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: recv_recv_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_freight_curr_id_fkey FOREIGN KEY (recv_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: recv_recv_itemsite_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_itemsite_id_fkey FOREIGN KEY (recv_itemsite_id) REFERENCES itemsite(itemsite_id);


--
-- Name: recv_recv_purchcost_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_purchcost_curr_id_fkey FOREIGN KEY (recv_purchcost_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: recv_recv_recvcost_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_recvcost_curr_id_fkey FOREIGN KEY (recv_recvcost_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: recv_recv_splitfrom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_splitfrom_id_fkey FOREIGN KEY (recv_splitfrom_id) REFERENCES recv(recv_id);


--
-- Name: recv_recv_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_vend_id_fkey FOREIGN KEY (recv_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: recv_recv_vohead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_vohead_id_fkey FOREIGN KEY (recv_vohead_id) REFERENCES vohead(vohead_id);


--
-- Name: recv_recv_voitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv
    ADD CONSTRAINT recv_recv_voitem_id_fkey FOREIGN KEY (recv_voitem_id) REFERENCES voitem(voitem_id);


--
-- Name: salesrep_salesrep_emp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY salesrep
    ADD CONSTRAINT salesrep_salesrep_emp_id_fkey FOREIGN KEY (salesrep_emp_id) REFERENCES emp(emp_id);


--
-- Name: shipdata_shipdata_base_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdata
    ADD CONSTRAINT shipdata_shipdata_base_freight_curr_id_fkey FOREIGN KEY (shipdata_base_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: shipdata_shipdata_shiphead_number_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdata
    ADD CONSTRAINT shipdata_shipdata_shiphead_number_fkey FOREIGN KEY (shipdata_shiphead_number) REFERENCES shiphead(shiphead_number);


--
-- Name: shipdata_shipdata_total_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdata
    ADD CONSTRAINT shipdata_shipdata_total_freight_curr_id_fkey FOREIGN KEY (shipdata_total_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: shipdatasum_shipdatasum_base_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdatasum
    ADD CONSTRAINT shipdatasum_shipdatasum_base_freight_curr_id_fkey FOREIGN KEY (shipdatasum_base_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: shipdatasum_shipdatasum_shiphead_number_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdatasum
    ADD CONSTRAINT shipdatasum_shipdatasum_shiphead_number_fkey FOREIGN KEY (shipdatasum_shiphead_number) REFERENCES shiphead(shiphead_number);


--
-- Name: shipdatasum_shipdatasum_total_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipdatasum
    ADD CONSTRAINT shipdatasum_shipdatasum_total_freight_curr_id_fkey FOREIGN KEY (shipdatasum_total_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: shiphead_shiphead_freight_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiphead
    ADD CONSTRAINT shiphead_shiphead_freight_curr_id_fkey FOREIGN KEY (shiphead_freight_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: shiphead_shiphead_shipchrg_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiphead
    ADD CONSTRAINT shiphead_shiphead_shipchrg_id_fkey FOREIGN KEY (shiphead_shipchrg_id) REFERENCES shipchrg(shipchrg_id);


--
-- Name: shiphead_shiphead_shipform_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiphead
    ADD CONSTRAINT shiphead_shiphead_shipform_id_fkey FOREIGN KEY (shiphead_shipform_id) REFERENCES shipform(shipform_id);


--
-- Name: shipitem_shipitem_invcitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipitem
    ADD CONSTRAINT shipitem_shipitem_invcitem_id_fkey FOREIGN KEY (shipitem_invcitem_id) REFERENCES invcitem(invcitem_id);


--
-- Name: shipitem_shipitem_invhist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipitem
    ADD CONSTRAINT shipitem_shipitem_invhist_id_fkey FOREIGN KEY (shipitem_invhist_id) REFERENCES invhist(invhist_id);


--
-- Name: shipitem_shipitem_shiphead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipitem
    ADD CONSTRAINT shipitem_shipitem_shiphead_id_fkey FOREIGN KEY (shipitem_shiphead_id) REFERENCES shiphead(shiphead_id);


--
-- Name: shiptoinfo_shipto_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_addr_id_fkey FOREIGN KEY (shipto_addr_id) REFERENCES addr(addr_id);


--
-- Name: shiptoinfo_shipto_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_cntct_id_fkey FOREIGN KEY (shipto_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: shiptoinfo_shipto_cust_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_cust_id_fkey FOREIGN KEY (shipto_cust_id) REFERENCES custinfo(cust_id);


--
-- Name: shiptoinfo_shipto_salesrep_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_salesrep_fkey FOREIGN KEY (shipto_salesrep_id) REFERENCES salesrep(salesrep_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: shiptoinfo_shipto_salesrep_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_salesrep_id_fkey FOREIGN KEY (shipto_salesrep_id) REFERENCES salesrep(salesrep_id);


--
-- Name: shiptoinfo_shipto_shipform_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_shipform_fkey FOREIGN KEY (shipto_shipform_id) REFERENCES shipform(shipform_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: shiptoinfo_shipto_shipform_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_shipform_id_fkey FOREIGN KEY (shipto_shipform_id) REFERENCES shipform(shipform_id);


--
-- Name: shiptoinfo_shipto_shipzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_shipzone_id_fkey FOREIGN KEY (shipto_shipzone_id) REFERENCES shipzone(shipzone_id);


--
-- Name: shiptoinfo_shipto_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiptoinfo
    ADD CONSTRAINT shiptoinfo_shipto_taxzone_id_fkey FOREIGN KEY (shipto_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: state_state_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY state
    ADD CONSTRAINT state_state_country_id_fkey FOREIGN KEY (state_country_id) REFERENCES country(country_id);


--
-- Name: tax_tax_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY tax
    ADD CONSTRAINT tax_tax_basis_tax_id_fkey FOREIGN KEY (tax_basis_tax_id) REFERENCES tax(tax_id) ON DELETE CASCADE;


--
-- Name: tax_tax_sales_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY tax
    ADD CONSTRAINT tax_tax_sales_accnt_id_fkey FOREIGN KEY (tax_sales_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: tax_tax_taxauth_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY tax
    ADD CONSTRAINT tax_tax_taxauth_id_fkey FOREIGN KEY (tax_taxauth_id) REFERENCES taxauth(taxauth_id);


--
-- Name: tax_tax_taxclass_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY tax
    ADD CONSTRAINT tax_tax_taxclass_id_fkey FOREIGN KEY (tax_taxclass_id) REFERENCES taxclass(taxclass_id);


--
-- Name: taxass_taxass_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxass
    ADD CONSTRAINT taxass_taxass_tax_id_fkey FOREIGN KEY (taxass_tax_id) REFERENCES tax(tax_id);


--
-- Name: taxass_taxass_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxass
    ADD CONSTRAINT taxass_taxass_taxtype_id_fkey FOREIGN KEY (taxass_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: taxass_taxass_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxass
    ADD CONSTRAINT taxass_taxass_taxzone_id_fkey FOREIGN KEY (taxass_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: taxauth_taxauth_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxauth
    ADD CONSTRAINT taxauth_taxauth_accnt_id_fkey FOREIGN KEY (taxauth_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: taxauth_taxauth_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxauth
    ADD CONSTRAINT taxauth_taxauth_addr_id_fkey FOREIGN KEY (taxauth_addr_id) REFERENCES addr(addr_id);


--
-- Name: taxauth_taxauth_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxauth
    ADD CONSTRAINT taxauth_taxauth_curr_id_fkey FOREIGN KEY (taxauth_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: taxhist_taxhist_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxhist
    ADD CONSTRAINT taxhist_taxhist_curr_id_fkey FOREIGN KEY (taxhist_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: taxhist_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxhist
    ADD CONSTRAINT taxhist_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: taxhist_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxhist
    ADD CONSTRAINT taxhist_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: taxrate_taxrate_curr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxrate
    ADD CONSTRAINT taxrate_taxrate_curr_id_fkey FOREIGN KEY (taxrate_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: taxrate_taxrate_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxrate
    ADD CONSTRAINT taxrate_taxrate_tax_id_fkey FOREIGN KEY (taxrate_tax_id) REFERENCES tax(tax_id);


--
-- Name: taxreg_taxreg_taxauth_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxreg
    ADD CONSTRAINT taxreg_taxreg_taxauth_id_fkey FOREIGN KEY (taxreg_taxauth_id) REFERENCES taxauth(taxauth_id);


--
-- Name: taxreg_taxreg_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxreg
    ADD CONSTRAINT taxreg_taxreg_taxzone_id_fkey FOREIGN KEY (taxreg_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: todoitem_todoitem_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem
    ADD CONSTRAINT todoitem_todoitem_cntct_id_fkey FOREIGN KEY (todoitem_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: todoitem_todoitem_crmacct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem
    ADD CONSTRAINT todoitem_todoitem_crmacct_id_fkey FOREIGN KEY (todoitem_crmacct_id) REFERENCES crmacct(crmacct_id);


--
-- Name: todoitem_todoitem_incdt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem
    ADD CONSTRAINT todoitem_todoitem_incdt_id_fkey FOREIGN KEY (todoitem_incdt_id) REFERENCES incdt(incdt_id);


--
-- Name: todoitem_todoitem_ophead_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem
    ADD CONSTRAINT todoitem_todoitem_ophead_id_fkey FOREIGN KEY (todoitem_ophead_id) REFERENCES ophead(ophead_id) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- Name: todoitem_todoitem_recurring_todoitem_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem
    ADD CONSTRAINT todoitem_todoitem_recurring_todoitem_id_fkey FOREIGN KEY (todoitem_recurring_todoitem_id) REFERENCES todoitem(todoitem_id);


--
-- Name: trgthist_trgthist_src_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY trgthist
    ADD CONSTRAINT trgthist_trgthist_src_cntct_id_fkey FOREIGN KEY (trgthist_src_cntct_id) REFERENCES cntctmrgd(cntctmrgd_cntct_id) ON DELETE CASCADE;


--
-- Name: trgthist_trgthist_trgt_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY trgthist
    ADD CONSTRAINT trgthist_trgthist_trgt_cntct_id_fkey FOREIGN KEY (trgthist_trgt_cntct_id) REFERENCES cntct(cntct_id) ON DELETE CASCADE;


--
-- Name: uomconv_uomconv_from_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomconv
    ADD CONSTRAINT uomconv_uomconv_from_uom_id_fkey FOREIGN KEY (uomconv_from_uom_id) REFERENCES uom(uom_id);


--
-- Name: uomconv_uomconv_to_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomconv
    ADD CONSTRAINT uomconv_uomconv_to_uom_id_fkey FOREIGN KEY (uomconv_to_uom_id) REFERENCES uom(uom_id);


--
-- Name: usrgrp_usrgrp_grp_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY usrgrp
    ADD CONSTRAINT usrgrp_usrgrp_grp_id_fkey FOREIGN KEY (usrgrp_grp_id) REFERENCES grp(grp_id);


--
-- Name: vend_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vend_to_curr_symbol FOREIGN KEY (vend_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: vend_vend_cntct1_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vend_vend_cntct1_id_fkey FOREIGN KEY (vend_cntct1_id) REFERENCES cntct(cntct_id);


--
-- Name: vend_vend_cntct2_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vend_vend_cntct2_id_fkey FOREIGN KEY (vend_cntct2_id) REFERENCES cntct(cntct_id);


--
-- Name: vendaddrinfo_vendaddr_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendaddrinfo
    ADD CONSTRAINT vendaddrinfo_vendaddr_addr_id_fkey FOREIGN KEY (vendaddr_addr_id) REFERENCES addr(addr_id);


--
-- Name: vendaddrinfo_vendaddr_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendaddrinfo
    ADD CONSTRAINT vendaddrinfo_vendaddr_cntct_id_fkey FOREIGN KEY (vendaddr_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: vendaddrinfo_vendaddr_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendaddrinfo
    ADD CONSTRAINT vendaddrinfo_vendaddr_taxzone_id_fkey FOREIGN KEY (vendaddr_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: vendinfo_vend_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vendinfo_vend_addr_id_fkey FOREIGN KEY (vend_addr_id) REFERENCES addr(addr_id);


--
-- Name: vendinfo_vend_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vendinfo_vend_taxzone_id_fkey FOREIGN KEY (vend_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: vendinfo_vend_vendtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendinfo
    ADD CONSTRAINT vendinfo_vend_vendtype_id_fkey FOREIGN KEY (vend_vendtype_id) REFERENCES vendtype(vendtype_id);


--
-- Name: vohead_to_curr_symbol; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_to_curr_symbol FOREIGN KEY (vohead_curr_id) REFERENCES curr_symbol(curr_id);


--
-- Name: vohead_vohead_adjtaxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_vohead_adjtaxtype_id_fkey FOREIGN KEY (vohead_adjtaxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: vohead_vohead_freighttaxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_vohead_freighttaxtype_id_fkey FOREIGN KEY (vohead_freighttaxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: vohead_vohead_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_vohead_taxtype_id_fkey FOREIGN KEY (vohead_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: vohead_vohead_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_vohead_taxzone_id_fkey FOREIGN KEY (vohead_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: vohead_vohead_vend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vohead
    ADD CONSTRAINT vohead_vohead_vend_id_fkey FOREIGN KEY (vohead_vend_id) REFERENCES vendinfo(vend_id);


--
-- Name: voheadtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax
    ADD CONSTRAINT voheadtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: voheadtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax
    ADD CONSTRAINT voheadtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES vohead(vohead_id) ON DELETE CASCADE;


--
-- Name: voheadtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax
    ADD CONSTRAINT voheadtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: voheadtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax
    ADD CONSTRAINT voheadtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: voitem_voitem_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitem
    ADD CONSTRAINT voitem_voitem_taxtype_id_fkey FOREIGN KEY (voitem_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: voitemtax_taxhist_basis_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax
    ADD CONSTRAINT voitemtax_taxhist_basis_tax_id_fkey FOREIGN KEY (taxhist_basis_tax_id) REFERENCES tax(tax_id);


--
-- Name: voitemtax_taxhist_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax
    ADD CONSTRAINT voitemtax_taxhist_parent_id_fkey FOREIGN KEY (taxhist_parent_id) REFERENCES voitem(voitem_id) ON DELETE CASCADE;


--
-- Name: voitemtax_taxhist_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax
    ADD CONSTRAINT voitemtax_taxhist_tax_id_fkey FOREIGN KEY (taxhist_tax_id) REFERENCES tax(tax_id);


--
-- Name: voitemtax_taxhist_taxtype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax
    ADD CONSTRAINT voitemtax_taxhist_taxtype_id_fkey FOREIGN KEY (taxhist_taxtype_id) REFERENCES taxtype(taxtype_id);


--
-- Name: whsinfo_warehous_accnt_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_accnt_id_fkey FOREIGN KEY (warehous_default_accnt_id) REFERENCES accnt(accnt_id);


--
-- Name: whsinfo_warehous_addr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_addr_id_fkey FOREIGN KEY (warehous_addr_id) REFERENCES addr(addr_id);


--
-- Name: whsinfo_warehous_cntct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_cntct_id_fkey FOREIGN KEY (warehous_cntct_id) REFERENCES cntct(cntct_id);


--
-- Name: whsinfo_warehous_costcat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_costcat_id_fkey FOREIGN KEY (warehous_costcat_id) REFERENCES costcat(costcat_id);


--
-- Name: whsinfo_warehous_shipform_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_shipform_id_fkey FOREIGN KEY (warehous_shipform_id) REFERENCES shipform(shipform_id);


--
-- Name: whsinfo_warehous_shipvia_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_shipvia_id_fkey FOREIGN KEY (warehous_shipvia_id) REFERENCES shipvia(shipvia_id);


--
-- Name: whsinfo_warehous_sitetype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_sitetype_id_fkey FOREIGN KEY (warehous_sitetype_id) REFERENCES sitetype(sitetype_id);


--
-- Name: whsinfo_warehous_taxzone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsinfo
    ADD CONSTRAINT whsinfo_warehous_taxzone_id_fkey FOREIGN KEY (warehous_taxzone_id) REFERENCES taxzone(taxzone_id);


--
-- Name: wo_wo_womatl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY wo
    ADD CONSTRAINT wo_wo_womatl_id_fkey FOREIGN KEY (wo_womatl_id) REFERENCES womatl(womatl_id) ON DELETE SET NULL;


--
-- Name: womatl_womatl_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY womatl
    ADD CONSTRAINT womatl_womatl_uom_id_fkey FOREIGN KEY (womatl_uom_id) REFERENCES uom(uom_id);


--
-- Name: womatlpost_womatlpost_invhist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY womatlpost
    ADD CONSTRAINT womatlpost_womatlpost_invhist_id_fkey FOREIGN KEY (womatlpost_invhist_id) REFERENCES invhist(invhist_id);


--
-- Name: womatlpost_womatlpost_womatl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY womatlpost
    ADD CONSTRAINT womatlpost_womatlpost_womatl_id_fkey FOREIGN KEY (womatlpost_womatl_id) REFERENCES womatl(womatl_id) ON DELETE CASCADE;



--
-- Name: pkgcmdarg_cmdarg_cmd_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkgcmdarg
    ADD CONSTRAINT pkgcmdarg_cmdarg_cmd_id_fkey FOREIGN KEY (cmdarg_cmd_id) REFERENCES pkgcmd(cmd_id);


--
-- Name: tecustrate_tecustrate_curr_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tecustrate
    ADD CONSTRAINT tecustrate_tecustrate_curr_id_fkey FOREIGN KEY (tecustrate_curr_id) REFERENCES public.curr_symbol(curr_id) ON DELETE SET DEFAULT;


--
-- Name: tecustrate_tecustrate_cust_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tecustrate
    ADD CONSTRAINT tecustrate_tecustrate_cust_id_fkey FOREIGN KEY (tecustrate_cust_id) REFERENCES public.custinfo(cust_id) ON DELETE CASCADE;


--
-- Name: teemp_teemp_emp_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teemp
    ADD CONSTRAINT teemp_teemp_emp_id_fkey FOREIGN KEY (teemp_emp_id) REFERENCES public.emp(emp_id) ON DELETE CASCADE;


--
-- Name: teitem_teitem_curr_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem
    ADD CONSTRAINT teitem_teitem_curr_id_fkey FOREIGN KEY (teitem_curr_id) REFERENCES public.curr_symbol(curr_id) ON DELETE SET DEFAULT;


--
-- Name: teitem_teitem_invcitem_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem
    ADD CONSTRAINT teitem_teitem_invcitem_id_fkey FOREIGN KEY (teitem_invcitem_id) REFERENCES public.invcitem(invcitem_id) ON DELETE SET NULL;


--
-- Name: teitem_teitem_prjtask_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem
    ADD CONSTRAINT teitem_teitem_prjtask_id_fkey FOREIGN KEY (teitem_prjtask_id) REFERENCES public.prjtask(prjtask_id);


--
-- Name: teitem_teitem_tehead_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem
    ADD CONSTRAINT teitem_teitem_tehead_id_fkey FOREIGN KEY (teitem_tehead_id) REFERENCES tehead(tehead_id) ON DELETE CASCADE;


--
-- Name: teitem_teitem_vodist_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem
    ADD CONSTRAINT teitem_teitem_vodist_id_fkey FOREIGN KEY (teitem_vodist_id) REFERENCES public.vodist(vodist_id) ON DELETE SET NULL;


--
-- Name: teprj_teprj_curr_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprj
    ADD CONSTRAINT teprj_teprj_curr_id_fkey FOREIGN KEY (teprj_curr_id) REFERENCES public.curr_symbol(curr_id) ON DELETE SET NULL;


--
-- Name: teprj_teprj_cust_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprj
    ADD CONSTRAINT teprj_teprj_cust_id_fkey FOREIGN KEY (teprj_cust_id) REFERENCES public.custinfo(cust_id) ON DELETE SET NULL;


--
-- Name: teprjtask_teprjtask_curr_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprjtask
    ADD CONSTRAINT teprjtask_teprjtask_curr_id_fkey FOREIGN KEY (teprjtask_curr_id) REFERENCES public.curr_symbol(curr_id) ON DELETE SET DEFAULT;


--
-- Name: teprjtask_teprjtask_item_id_fkey; Type: FK CONSTRAINT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprjtask
    ADD CONSTRAINT teprjtask_teprjtask_item_id_fkey FOREIGN KEY (teprjtask_item_id) REFERENCES public.item(item_id) ON DELETE SET NULL;



--
-- Name: pkgcmdarg_cmdarg_cmd_id_fkey; Type: FK CONSTRAINT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkgcmdarg
    ADD CONSTRAINT pkgcmdarg_cmdarg_cmd_id_fkey FOREIGN KEY (cmdarg_cmd_id) REFERENCES pkgcmd(cmd_id);


--
-- Name: api; Type: ACL; Schema: -; Owner: admin
--

REVOKE ALL ON SCHEMA api FROM PUBLIC;
REVOKE ALL ON SCHEMA api FROM admin;
GRANT ALL ON SCHEMA api TO admin;
GRANT ALL ON SCHEMA api TO xtrole;


--
-- Name: fixcountry; Type: ACL; Schema: -; Owner: admin
--

REVOKE ALL ON SCHEMA fixcountry FROM PUBLIC;
REVOKE ALL ON SCHEMA fixcountry FROM admin;
GRANT ALL ON SCHEMA fixcountry TO admin;
GRANT ALL ON SCHEMA fixcountry TO xtrole;


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- Name: te; Type: ACL; Schema: -; Owner: admin
--

REVOKE ALL ON SCHEMA te FROM PUBLIC;
REVOKE ALL ON SCHEMA te FROM admin;
GRANT ALL ON SCHEMA te TO admin;
GRANT ALL ON SCHEMA te TO xtrole;


--
-- Name: xt; Type: ACL; Schema: -; Owner: admin
--

REVOKE ALL ON SCHEMA xt FROM PUBLIC;
REVOKE ALL ON SCHEMA xt FROM admin;
GRANT ALL ON SCHEMA xt TO admin;
GRANT ALL ON SCHEMA xt TO xtrole;


--
-- Name: xtdesktop; Type: ACL; Schema: -; Owner: admin
--

REVOKE ALL ON SCHEMA xtdesktop FROM PUBLIC;
REVOKE ALL ON SCHEMA xtdesktop FROM admin;
GRANT ALL ON SCHEMA xtdesktop TO admin;
GRANT ALL ON SCHEMA xtdesktop TO xtrole;



--
-- Name: cntslip; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntslip FROM PUBLIC;
REVOKE ALL ON TABLE cntslip FROM admin;
GRANT ALL ON TABLE cntslip TO admin;
GRANT ALL ON TABLE cntslip TO xtrole;


--
-- Name: invcnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invcnt FROM PUBLIC;
REVOKE ALL ON TABLE invcnt FROM admin;
GRANT ALL ON TABLE invcnt TO admin;
GRANT ALL ON TABLE invcnt TO xtrole;


--
-- Name: item; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE item FROM PUBLIC;
REVOKE ALL ON TABLE item FROM admin;
GRANT ALL ON TABLE item TO admin;
GRANT ALL ON TABLE item TO xtrole;


--
-- Name: itemsite; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemsite FROM PUBLIC;
REVOKE ALL ON TABLE itemsite FROM admin;
GRANT ALL ON TABLE itemsite TO admin;
GRANT ALL ON TABLE itemsite TO xtrole;


--
-- Name: whsinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE whsinfo FROM PUBLIC;
REVOKE ALL ON TABLE whsinfo FROM admin;
GRANT ALL ON TABLE whsinfo TO admin;
GRANT ALL ON TABLE whsinfo TO xtrole;



--
-- Name: physinvcount; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE physinvcount FROM PUBLIC;
REVOKE ALL ON TABLE physinvcount FROM admin;
GRANT ALL ON TABLE physinvcount TO admin;
GRANT ALL ON TABLE physinvcount TO xtrole;



--
-- Name: cohead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cohead FROM PUBLIC;
REVOKE ALL ON TABLE cohead FROM admin;
GRANT ALL ON TABLE cohead TO admin;
GRANT ALL ON TABLE cohead TO xtrole;


--
-- Name: coitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE coitem FROM PUBLIC;
REVOKE ALL ON TABLE coitem FROM admin;
GRANT ALL ON TABLE coitem TO admin;
GRANT ALL ON TABLE coitem TO xtrole;


--
-- Name: pohead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pohead FROM PUBLIC;
REVOKE ALL ON TABLE pohead FROM admin;
GRANT ALL ON TABLE pohead TO admin;
GRANT ALL ON TABLE pohead TO xtrole;


--
-- Name: poitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE poitem FROM PUBLIC;
REVOKE ALL ON TABLE poitem FROM admin;
GRANT ALL ON TABLE poitem TO admin;
GRANT ALL ON TABLE poitem TO xtrole;


--
-- Name: taxtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxtype FROM PUBLIC;
REVOKE ALL ON TABLE taxtype FROM admin;
GRANT ALL ON TABLE taxtype TO admin;
GRANT ALL ON TABLE taxtype TO xtrole;


--
-- Name: uom; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE uom FROM PUBLIC;
REVOKE ALL ON TABLE uom FROM admin;
GRANT ALL ON TABLE uom TO admin;
GRANT ALL ON TABLE uom TO xtrole;



--
-- Name: salesline; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE salesline FROM PUBLIC;
REVOKE ALL ON TABLE salesline FROM admin;
GRANT ALL ON TABLE salesline TO admin;
GRANT ALL ON TABLE salesline TO xtrole;



--
-- Name: invbal; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invbal FROM PUBLIC;
REVOKE ALL ON TABLE invbal FROM admin;
GRANT ALL ON TABLE invbal TO admin;
GRANT ALL ON TABLE invbal TO xtrole;


--
-- Name: bomitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bomitem FROM PUBLIC;
REVOKE ALL ON TABLE bomitem FROM admin;
GRANT ALL ON TABLE bomitem TO admin;
GRANT ALL ON TABLE bomitem TO xtrole;


--
-- Name: cntct; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntct FROM PUBLIC;
REVOKE ALL ON TABLE cntct FROM admin;
GRANT ALL ON TABLE cntct TO admin;
GRANT ALL ON TABLE cntct TO xtrole;


--
-- Name: crmacct; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE crmacct FROM PUBLIC;
REVOKE ALL ON TABLE crmacct FROM admin;
GRANT ALL ON TABLE crmacct TO admin;
GRANT ALL ON TABLE crmacct TO xtrole;


--
-- Name: incdt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdt FROM PUBLIC;
REVOKE ALL ON TABLE incdt FROM admin;
GRANT ALL ON TABLE incdt TO admin;
GRANT ALL ON TABLE incdt TO xtrole;


--
-- Name: apopen; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apopen FROM PUBLIC;
REVOKE ALL ON TABLE apopen FROM admin;
GRANT ALL ON TABLE apopen TO admin;
GRANT ALL ON TABLE apopen TO xtrole;


--
-- Name: curr_symbol; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE curr_symbol FROM PUBLIC;
REVOKE ALL ON TABLE curr_symbol FROM admin;
GRANT ALL ON TABLE curr_symbol TO admin;
GRANT ALL ON TABLE curr_symbol TO xtrole;


--
-- Name: terms; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE terms FROM PUBLIC;
REVOKE ALL ON TABLE terms FROM admin;
GRANT ALL ON TABLE terms TO admin;
GRANT ALL ON TABLE terms TO xtrole;


--
-- Name: vendinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vendinfo FROM PUBLIC;
REVOKE ALL ON TABLE vendinfo FROM admin;
GRANT ALL ON TABLE vendinfo TO admin;
GRANT ALL ON TABLE vendinfo TO xtrole;



--
-- Name: apmemo; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE apmemo FROM PUBLIC;
REVOKE ALL ON TABLE apmemo FROM admin;
GRANT ALL ON TABLE apmemo TO admin;
GRANT ALL ON TABLE apmemo TO xtrole;



--
-- Name: aropen; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE aropen FROM PUBLIC;
REVOKE ALL ON TABLE aropen FROM admin;
GRANT ALL ON TABLE aropen TO admin;
GRANT ALL ON TABLE aropen TO xtrole;


--
-- Name: custinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE custinfo FROM PUBLIC;
REVOKE ALL ON TABLE custinfo FROM admin;
GRANT ALL ON TABLE custinfo TO admin;
GRANT ALL ON TABLE custinfo TO xtrole;


--
-- Name: rsncode; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE rsncode FROM PUBLIC;
REVOKE ALL ON TABLE rsncode FROM admin;
GRANT ALL ON TABLE rsncode TO admin;
GRANT ALL ON TABLE rsncode TO xtrole;


--
-- Name: salescat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE salescat FROM PUBLIC;
REVOKE ALL ON TABLE salescat FROM admin;
GRANT ALL ON TABLE salescat TO admin;
GRANT ALL ON TABLE salescat TO xtrole;


--
-- Name: salesrep; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE salesrep FROM PUBLIC;
REVOKE ALL ON TABLE salesrep FROM admin;
GRANT ALL ON TABLE salesrep TO admin;
GRANT ALL ON TABLE salesrep TO xtrole;



--
-- Name: armemo; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE armemo FROM PUBLIC;
REVOKE ALL ON TABLE armemo FROM admin;
GRANT ALL ON TABLE armemo TO admin;
GRANT ALL ON TABLE armemo TO xtrole;



--
-- Name: cmhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmhead FROM PUBLIC;
REVOKE ALL ON TABLE cmhead FROM admin;
GRANT ALL ON TABLE cmhead TO admin;
GRANT ALL ON TABLE cmhead TO xtrole;


--
-- Name: shiptoinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shiptoinfo FROM PUBLIC;
REVOKE ALL ON TABLE shiptoinfo FROM admin;
GRANT ALL ON TABLE shiptoinfo TO admin;
GRANT ALL ON TABLE shiptoinfo TO xtrole;


--
-- Name: taxzone; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxzone FROM PUBLIC;
REVOKE ALL ON TABLE taxzone FROM admin;
GRANT ALL ON TABLE taxzone TO admin;
GRANT ALL ON TABLE taxzone TO xtrole;



--
-- Name: creditmemo; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE creditmemo FROM PUBLIC;
REVOKE ALL ON TABLE creditmemo FROM admin;
GRANT ALL ON TABLE creditmemo TO admin;
GRANT ALL ON TABLE creditmemo TO xtrole;



--
-- Name: cmitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmitem FROM PUBLIC;
REVOKE ALL ON TABLE cmitem FROM admin;
GRANT ALL ON TABLE cmitem TO admin;
GRANT ALL ON TABLE cmitem TO xtrole;



--
-- Name: creditmemoline; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE creditmemoline FROM PUBLIC;
REVOKE ALL ON TABLE creditmemoline FROM admin;
GRANT ALL ON TABLE creditmemoline TO admin;
GRANT ALL ON TABLE creditmemoline TO xtrole;



--
-- Name: invchead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invchead FROM PUBLIC;
REVOKE ALL ON TABLE invchead FROM admin;
GRANT ALL ON TABLE invchead TO admin;
GRANT ALL ON TABLE invchead TO xtrole;


--
-- Name: prj; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prj FROM PUBLIC;
REVOKE ALL ON TABLE prj FROM admin;
GRANT ALL ON TABLE prj TO admin;
GRANT ALL ON TABLE prj TO xtrole;


--
-- Name: saletype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE saletype FROM PUBLIC;
REVOKE ALL ON TABLE saletype FROM admin;
GRANT ALL ON TABLE saletype TO admin;
GRANT ALL ON TABLE saletype TO xtrole;


--
-- Name: shipzone; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipzone FROM PUBLIC;
REVOKE ALL ON TABLE shipzone FROM admin;
GRANT ALL ON TABLE shipzone TO admin;
GRANT ALL ON TABLE shipzone TO xtrole;



--
-- Name: invoice; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE invoice FROM PUBLIC;
REVOKE ALL ON TABLE invoice FROM admin;
GRANT ALL ON TABLE invoice TO admin;
GRANT ALL ON TABLE invoice TO xtrole;



--
-- Name: invcitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invcitem FROM PUBLIC;
REVOKE ALL ON TABLE invcitem FROM admin;
GRANT ALL ON TABLE invcitem TO admin;
GRANT ALL ON TABLE invcitem TO xtrole;



--
-- Name: invoiceline; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE invoiceline FROM PUBLIC;
REVOKE ALL ON TABLE invoiceline FROM admin;
GRANT ALL ON TABLE invoiceline TO admin;
GRANT ALL ON TABLE invoiceline TO xtrole;



--
-- Name: ophead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ophead FROM PUBLIC;
REVOKE ALL ON TABLE ophead FROM admin;
GRANT ALL ON TABLE ophead TO admin;
GRANT ALL ON TABLE ophead TO xtrole;


--
-- Name: prjtask; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prjtask FROM PUBLIC;
REVOKE ALL ON TABLE prjtask FROM admin;
GRANT ALL ON TABLE prjtask TO admin;
GRANT ALL ON TABLE prjtask TO xtrole;


--
-- Name: todoitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE todoitem FROM PUBLIC;
REVOKE ALL ON TABLE todoitem FROM admin;
GRANT ALL ON TABLE todoitem TO admin;
GRANT ALL ON TABLE todoitem TO xtrole;


--
-- Name: addr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE addr FROM PUBLIC;
REVOKE ALL ON TABLE addr FROM admin;
GRANT ALL ON TABLE addr TO admin;
GRANT ALL ON TABLE addr TO xtrole;



--
-- Name: account; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE account FROM PUBLIC;
REVOKE ALL ON TABLE account FROM admin;
GRANT ALL ON TABLE account TO admin;
GRANT ALL ON TABLE account TO xtrole;



--
-- Name: char; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE "char" FROM PUBLIC;
REVOKE ALL ON TABLE "char" FROM admin;
GRANT ALL ON TABLE "char" TO admin;
GRANT ALL ON TABLE "char" TO xtrole;


--
-- Name: charass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE charass FROM PUBLIC;
REVOKE ALL ON TABLE charass FROM admin;
GRANT ALL ON TABLE charass TO admin;
GRANT ALL ON TABLE charass TO xtrole;



--
-- Name: accountchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE accountchar FROM PUBLIC;
REVOKE ALL ON TABLE accountchar FROM admin;
GRANT ALL ON TABLE accountchar TO admin;
GRANT ALL ON TABLE accountchar TO xtrole;



--
-- Name: cmnttype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmnttype FROM PUBLIC;
REVOKE ALL ON TABLE cmnttype FROM admin;
GRANT ALL ON TABLE cmnttype TO admin;
GRANT ALL ON TABLE cmnttype TO xtrole;


--
-- Name: comment; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE comment FROM PUBLIC;
REVOKE ALL ON TABLE comment FROM admin;
GRANT ALL ON TABLE comment TO admin;
GRANT ALL ON TABLE comment TO xtrole;



--
-- Name: accountcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE accountcomment FROM PUBLIC;
REVOKE ALL ON TABLE accountcomment FROM admin;
GRANT ALL ON TABLE accountcomment TO admin;
GRANT ALL ON TABLE accountcomment TO xtrole;



--
-- Name: docass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE docass FROM PUBLIC;
REVOKE ALL ON TABLE docass FROM admin;
GRANT ALL ON TABLE docass TO admin;
GRANT ALL ON TABLE docass TO xtrole;


--
-- Name: file; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE file FROM PUBLIC;
REVOKE ALL ON TABLE file FROM admin;
GRANT ALL ON TABLE file TO admin;
GRANT ALL ON TABLE file TO xtrole;


--
-- Name: urlinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE urlinfo FROM PUBLIC;
REVOKE ALL ON TABLE urlinfo FROM admin;
GRANT ALL ON TABLE urlinfo TO admin;
GRANT ALL ON TABLE urlinfo TO xtrole;


--
-- Name: url; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE url FROM PUBLIC;
REVOKE ALL ON TABLE url FROM admin;
GRANT ALL ON TABLE url TO admin;
GRANT ALL ON TABLE url TO xtrole;



--
-- Name: accountfile; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE accountfile FROM PUBLIC;
REVOKE ALL ON TABLE accountfile FROM admin;
GRANT ALL ON TABLE accountfile TO admin;
GRANT ALL ON TABLE accountfile TO xtrole;



--
-- Name: docass_docass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE docass_docass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE docass_docass_id_seq FROM admin;
GRANT ALL ON SEQUENCE docass_docass_id_seq TO admin;
GRANT ALL ON SEQUENCE docass_docass_id_seq TO xtrole;


--
-- Name: image; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE image FROM PUBLIC;
REVOKE ALL ON TABLE image FROM admin;
GRANT ALL ON TABLE image TO admin;
GRANT ALL ON TABLE image TO xtrole;


--
-- Name: imageass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE imageass FROM PUBLIC;
REVOKE ALL ON TABLE imageass FROM admin;
GRANT ALL ON TABLE imageass TO admin;
GRANT ALL ON TABLE imageass TO xtrole;



--
-- Name: accountimage; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE accountimage FROM PUBLIC;
REVOKE ALL ON TABLE accountimage FROM admin;
GRANT ALL ON TABLE accountimage TO admin;
GRANT ALL ON TABLE accountimage TO xtrole;


--
-- Name: address; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE address FROM PUBLIC;
REVOKE ALL ON TABLE address FROM admin;
GRANT ALL ON TABLE address TO admin;
GRANT ALL ON TABLE address TO xtrole;


--
-- Name: addresschar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE addresschar FROM PUBLIC;
REVOKE ALL ON TABLE addresschar FROM admin;
GRANT ALL ON TABLE addresschar TO admin;
GRANT ALL ON TABLE addresschar TO xtrole;


--
-- Name: addresscomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE addresscomment FROM PUBLIC;
REVOKE ALL ON TABLE addresscomment FROM admin;
GRANT ALL ON TABLE addresscomment TO admin;
GRANT ALL ON TABLE addresscomment TO xtrole;



--
-- Name: bomhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bomhead FROM PUBLIC;
REVOKE ALL ON TABLE bomhead FROM admin;
GRANT ALL ON TABLE bomhead TO admin;
GRANT ALL ON TABLE bomhead TO xtrole;



--
-- Name: bom; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE bom FROM PUBLIC;
REVOKE ALL ON TABLE bom FROM admin;
GRANT ALL ON TABLE bom TO admin;
GRANT ALL ON TABLE bom TO xtrole;


--
-- Name: bomitem; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE bomitem FROM PUBLIC;
REVOKE ALL ON TABLE bomitem FROM admin;
GRANT ALL ON TABLE bomitem TO admin;
GRANT ALL ON TABLE bomitem TO xtrole;


--
-- Name: bomitemcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE bomitemcomment FROM PUBLIC;
REVOKE ALL ON TABLE bomitemcomment FROM admin;
GRANT ALL ON TABLE bomitemcomment TO admin;
GRANT ALL ON TABLE bomitemcomment TO xtrole;



--
-- Name: bomitemsub; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bomitemsub FROM PUBLIC;
REVOKE ALL ON TABLE bomitemsub FROM admin;
GRANT ALL ON TABLE bomitemsub TO admin;
GRANT ALL ON TABLE bomitemsub TO xtrole;



--
-- Name: bomitemsubstitute; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE bomitemsubstitute FROM PUBLIC;
REVOKE ALL ON TABLE bomitemsubstitute FROM admin;
GRANT ALL ON TABLE bomitemsubstitute TO admin;
GRANT ALL ON TABLE bomitemsubstitute TO xtrole;



--
-- Name: budghead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE budghead FROM PUBLIC;
REVOKE ALL ON TABLE budghead FROM admin;
GRANT ALL ON TABLE budghead TO admin;
GRANT ALL ON TABLE budghead TO xtrole;



--
-- Name: budget; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE budget FROM PUBLIC;
REVOKE ALL ON TABLE budget FROM admin;
GRANT ALL ON TABLE budget TO admin;
GRANT ALL ON TABLE budget TO xtrole;



--
-- Name: accnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE accnt FROM PUBLIC;
REVOKE ALL ON TABLE accnt FROM admin;
GRANT ALL ON TABLE accnt TO admin;
GRANT ALL ON TABLE accnt TO xtrole;


--
-- Name: budgitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE budgitem FROM PUBLIC;
REVOKE ALL ON TABLE budgitem FROM admin;
GRANT ALL ON TABLE budgitem TO admin;
GRANT ALL ON TABLE budgitem TO xtrole;


--
-- Name: period; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE period FROM PUBLIC;
REVOKE ALL ON TABLE period FROM admin;
GRANT ALL ON TABLE period TO admin;
GRANT ALL ON TABLE period TO xtrole;



--
-- Name: budgetentry; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE budgetentry FROM PUBLIC;
REVOKE ALL ON TABLE budgetentry FROM admin;
GRANT ALL ON TABLE budgetentry TO admin;
GRANT ALL ON TABLE budgetentry TO xtrole;



--
-- Name: bankaccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankaccnt FROM PUBLIC;
REVOKE ALL ON TABLE bankaccnt FROM admin;
GRANT ALL ON TABLE bankaccnt TO admin;
GRANT ALL ON TABLE bankaccnt TO xtrole;


--
-- Name: cashrcpt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cashrcpt FROM PUBLIC;
REVOKE ALL ON TABLE cashrcpt FROM admin;
GRANT ALL ON TABLE cashrcpt TO admin;
GRANT ALL ON TABLE cashrcpt TO xtrole;



--
-- Name: cashreceipt; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE cashreceipt FROM PUBLIC;
REVOKE ALL ON TABLE cashreceipt FROM admin;
GRANT ALL ON TABLE cashreceipt TO admin;
GRANT ALL ON TABLE cashreceipt TO xtrole;



--
-- Name: cashrcptitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cashrcptitem FROM PUBLIC;
REVOKE ALL ON TABLE cashrcptitem FROM admin;
GRANT ALL ON TABLE cashrcptitem TO admin;
GRANT ALL ON TABLE cashrcptitem TO xtrole;



--
-- Name: cashreceiptapply; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE cashreceiptapply FROM PUBLIC;
REVOKE ALL ON TABLE cashreceiptapply FROM admin;
GRANT ALL ON TABLE cashreceiptapply TO admin;
GRANT ALL ON TABLE cashreceiptapply TO xtrole;



--
-- Name: cashrcptmisc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cashrcptmisc FROM PUBLIC;
REVOKE ALL ON TABLE cashrcptmisc FROM admin;
GRANT ALL ON TABLE cashrcptmisc TO admin;
GRANT ALL ON TABLE cashrcptmisc TO xtrole;



--
-- Name: cashreceiptapplymisc; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE cashreceiptapplymisc FROM PUBLIC;
REVOKE ALL ON TABLE cashreceiptapplymisc FROM admin;
GRANT ALL ON TABLE cashreceiptapplymisc TO admin;
GRANT ALL ON TABLE cashreceiptapplymisc TO xtrole;


--
-- Name: contact; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE contact FROM PUBLIC;
REVOKE ALL ON TABLE contact FROM admin;
GRANT ALL ON TABLE contact TO admin;
GRANT ALL ON TABLE contact TO xtrole;


--
-- Name: contactchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE contactchar FROM PUBLIC;
REVOKE ALL ON TABLE contactchar FROM admin;
GRANT ALL ON TABLE contactchar TO admin;
GRANT ALL ON TABLE contactchar TO xtrole;


--
-- Name: contactcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE contactcomment FROM PUBLIC;
REVOKE ALL ON TABLE contactcomment FROM admin;
GRANT ALL ON TABLE contactcomment TO admin;
GRANT ALL ON TABLE contactcomment TO xtrole;


--
-- Name: custchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE custchar FROM PUBLIC;
REVOKE ALL ON TABLE custchar FROM admin;
GRANT ALL ON TABLE custchar TO admin;
GRANT ALL ON TABLE custchar TO xtrole;


--
-- Name: custcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE custcomment FROM PUBLIC;
REVOKE ALL ON TABLE custcomment FROM admin;
GRANT ALL ON TABLE custcomment TO admin;
GRANT ALL ON TABLE custcomment TO xtrole;



--
-- Name: ccard; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ccard FROM PUBLIC;
REVOKE ALL ON TABLE ccard FROM admin;
GRANT ALL ON TABLE ccard TO admin;
GRANT ALL ON TABLE ccard TO xtrole;



--
-- Name: custcreditcard; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE custcreditcard FROM PUBLIC;
REVOKE ALL ON TABLE custcreditcard FROM admin;
GRANT ALL ON TABLE custcreditcard TO admin;
GRANT ALL ON TABLE custcreditcard TO xtrole;



--
-- Name: custtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE custtype FROM PUBLIC;
REVOKE ALL ON TABLE custtype FROM admin;
GRANT ALL ON TABLE custtype TO admin;
GRANT ALL ON TABLE custtype TO xtrole;


--
-- Name: shipchrg; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipchrg FROM PUBLIC;
REVOKE ALL ON TABLE shipchrg FROM admin;
GRANT ALL ON TABLE shipchrg TO admin;
GRANT ALL ON TABLE shipchrg TO xtrole;


--
-- Name: shipform; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipform FROM PUBLIC;
REVOKE ALL ON TABLE shipform FROM admin;
GRANT ALL ON TABLE shipform TO admin;
GRANT ALL ON TABLE shipform TO xtrole;



--
-- Name: customer; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE customer FROM PUBLIC;
REVOKE ALL ON TABLE customer FROM admin;
GRANT ALL ON TABLE customer TO admin;
GRANT ALL ON TABLE customer TO xtrole;



--
-- Name: taxauth; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxauth FROM PUBLIC;
REVOKE ALL ON TABLE taxauth FROM admin;
GRANT ALL ON TABLE taxauth TO admin;
GRANT ALL ON TABLE taxauth TO xtrole;


--
-- Name: taxreg; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxreg FROM PUBLIC;
REVOKE ALL ON TABLE taxreg FROM admin;
GRANT ALL ON TABLE taxreg TO admin;
GRANT ALL ON TABLE taxreg TO xtrole;



--
-- Name: customertaxreg; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE customertaxreg FROM PUBLIC;
REVOKE ALL ON TABLE customertaxreg FROM admin;
GRANT ALL ON TABLE customertaxreg TO admin;
GRANT ALL ON TABLE customertaxreg TO xtrole;


--
-- Name: customertype; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE customertype FROM PUBLIC;
REVOKE ALL ON TABLE customertype FROM admin;
GRANT ALL ON TABLE customertype TO admin;
GRANT ALL ON TABLE customertype TO xtrole;


--
-- Name: customertypechar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE customertypechar FROM PUBLIC;
REVOKE ALL ON TABLE customertypechar FROM admin;
GRANT ALL ON TABLE customertypechar TO admin;
GRANT ALL ON TABLE customertypechar TO xtrole;


--
-- Name: custshipto; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE custshipto FROM PUBLIC;
REVOKE ALL ON TABLE custshipto FROM admin;
GRANT ALL ON TABLE custshipto TO admin;
GRANT ALL ON TABLE custshipto TO xtrole;


--
-- Name: custtax; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE custtax FROM PUBLIC;
REVOKE ALL ON TABLE custtax FROM admin;
GRANT ALL ON TABLE custtax TO admin;
GRANT ALL ON TABLE custtax TO xtrole;



--
-- Name: dept; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE dept FROM PUBLIC;
REVOKE ALL ON TABLE dept FROM admin;
GRANT ALL ON TABLE dept TO admin;
GRANT ALL ON TABLE dept TO xtrole;


--
-- Name: emp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE emp FROM PUBLIC;
REVOKE ALL ON TABLE emp FROM admin;
GRANT ALL ON TABLE emp TO admin;
GRANT ALL ON TABLE emp TO xtrole;


--
-- Name: shift; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shift FROM PUBLIC;
REVOKE ALL ON TABLE shift FROM admin;
GRANT ALL ON TABLE shift TO admin;
GRANT ALL ON TABLE shift TO xtrole;



--
-- Name: employee; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE employee FROM PUBLIC;
REVOKE ALL ON TABLE employee FROM admin;
GRANT ALL ON TABLE employee TO admin;
GRANT ALL ON TABLE employee TO xtrole;


--
-- Name: employeechar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE employeechar FROM PUBLIC;
REVOKE ALL ON TABLE employeechar FROM admin;
GRANT ALL ON TABLE employeechar TO admin;
GRANT ALL ON TABLE employeechar TO xtrole;


--
-- Name: employeecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE employeecomment FROM PUBLIC;
REVOKE ALL ON TABLE employeecomment FROM admin;
GRANT ALL ON TABLE employeecomment TO admin;
GRANT ALL ON TABLE employeecomment TO xtrole;



--
-- Name: shipdata; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipdata FROM PUBLIC;
REVOKE ALL ON TABLE shipdata FROM admin;
GRANT ALL ON TABLE shipdata TO admin;
GRANT ALL ON TABLE shipdata TO xtrole;



--
-- Name: extshipmaint; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE extshipmaint FROM PUBLIC;
REVOKE ALL ON TABLE extshipmaint FROM admin;
GRANT ALL ON TABLE extshipmaint TO admin;
GRANT ALL ON TABLE extshipmaint TO xtrole;



--
-- Name: freightclass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE freightclass FROM PUBLIC;
REVOKE ALL ON TABLE freightclass FROM admin;
GRANT ALL ON TABLE freightclass TO admin;
GRANT ALL ON TABLE freightclass TO xtrole;


--
-- Name: ipsfreight; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsfreight FROM PUBLIC;
REVOKE ALL ON TABLE ipsfreight FROM admin;
GRANT ALL ON TABLE ipsfreight TO admin;
GRANT ALL ON TABLE ipsfreight TO xtrole;


--
-- Name: ipshead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipshead FROM PUBLIC;
REVOKE ALL ON TABLE ipshead FROM admin;
GRANT ALL ON TABLE ipshead TO admin;
GRANT ALL ON TABLE ipshead TO xtrole;



--
-- Name: freightpricingscheduleitem; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE freightpricingscheduleitem FROM PUBLIC;
REVOKE ALL ON TABLE freightpricingscheduleitem FROM admin;
GRANT ALL ON TABLE freightpricingscheduleitem TO admin;
GRANT ALL ON TABLE freightpricingscheduleitem TO xtrole;


--
-- Name: glaccount; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE glaccount FROM PUBLIC;
REVOKE ALL ON TABLE glaccount FROM admin;
GRANT ALL ON TABLE glaccount TO admin;
GRANT ALL ON TABLE glaccount TO xtrole;



--
-- Name: incdtcat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdtcat FROM PUBLIC;
REVOKE ALL ON TABLE incdtcat FROM admin;
GRANT ALL ON TABLE incdtcat TO admin;
GRANT ALL ON TABLE incdtcat TO xtrole;


--
-- Name: incdtpriority; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdtpriority FROM PUBLIC;
REVOKE ALL ON TABLE incdtpriority FROM admin;
GRANT ALL ON TABLE incdtpriority TO admin;
GRANT ALL ON TABLE incdtpriority TO xtrole;


--
-- Name: incdtresolution; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdtresolution FROM PUBLIC;
REVOKE ALL ON TABLE incdtresolution FROM admin;
GRANT ALL ON TABLE incdtresolution TO admin;
GRANT ALL ON TABLE incdtresolution TO xtrole;


--
-- Name: incdtseverity; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdtseverity FROM PUBLIC;
REVOKE ALL ON TABLE incdtseverity FROM admin;
GRANT ALL ON TABLE incdtseverity TO admin;
GRANT ALL ON TABLE incdtseverity TO xtrole;



--
-- Name: incident; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE incident FROM PUBLIC;
REVOKE ALL ON TABLE incident FROM admin;
GRANT ALL ON TABLE incident TO admin;
GRANT ALL ON TABLE incident TO xtrole;


--
-- Name: incidentchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE incidentchar FROM PUBLIC;
REVOKE ALL ON TABLE incidentchar FROM admin;
GRANT ALL ON TABLE incidentchar TO admin;
GRANT ALL ON TABLE incidentchar TO xtrole;


--
-- Name: incidentcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE incidentcomment FROM PUBLIC;
REVOKE ALL ON TABLE incidentcomment FROM admin;
GRANT ALL ON TABLE incidentcomment TO admin;
GRANT ALL ON TABLE incidentcomment TO xtrole;


--
-- Name: incidentfile; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE incidentfile FROM PUBLIC;
REVOKE ALL ON TABLE incidentfile FROM admin;
GRANT ALL ON TABLE incidentfile TO admin;
GRANT ALL ON TABLE incidentfile TO xtrole;


--
-- Name: incidentimage; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE incidentimage FROM PUBLIC;
REVOKE ALL ON TABLE incidentimage FROM admin;
GRANT ALL ON TABLE incidentimage TO admin;
GRANT ALL ON TABLE incidentimage TO xtrole;



--
-- Name: classcode; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE classcode FROM PUBLIC;
REVOKE ALL ON TABLE classcode FROM admin;
GRANT ALL ON TABLE classcode TO admin;
GRANT ALL ON TABLE classcode TO xtrole;


--
-- Name: prodcat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prodcat FROM PUBLIC;
REVOKE ALL ON TABLE prodcat FROM admin;
GRANT ALL ON TABLE prodcat TO admin;
GRANT ALL ON TABLE prodcat TO xtrole;



--
-- Name: item; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE item FROM PUBLIC;
REVOKE ALL ON TABLE item FROM admin;
GRANT ALL ON TABLE item TO admin;
GRANT ALL ON TABLE item TO xtrole;



--
-- Name: itemalias; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemalias FROM PUBLIC;
REVOKE ALL ON TABLE itemalias FROM admin;
GRANT ALL ON TABLE itemalias TO admin;
GRANT ALL ON TABLE itemalias TO xtrole;



--
-- Name: itemalias; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemalias FROM PUBLIC;
REVOKE ALL ON TABLE itemalias FROM admin;
GRANT ALL ON TABLE itemalias TO admin;
GRANT ALL ON TABLE itemalias TO xtrole;


--
-- Name: itemchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemchar FROM PUBLIC;
REVOKE ALL ON TABLE itemchar FROM admin;
GRANT ALL ON TABLE itemchar TO admin;
GRANT ALL ON TABLE itemchar TO xtrole;


--
-- Name: itemcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemcomment FROM PUBLIC;
REVOKE ALL ON TABLE itemcomment FROM admin;
GRANT ALL ON TABLE itemcomment TO admin;
GRANT ALL ON TABLE itemcomment TO xtrole;



--
-- Name: costelem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE costelem FROM PUBLIC;
REVOKE ALL ON TABLE costelem FROM admin;
GRANT ALL ON TABLE costelem TO admin;
GRANT ALL ON TABLE costelem TO xtrole;


--
-- Name: itemcost; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemcost FROM PUBLIC;
REVOKE ALL ON TABLE itemcost FROM admin;
GRANT ALL ON TABLE itemcost TO admin;
GRANT ALL ON TABLE itemcost TO xtrole;



--
-- Name: itemcost; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemcost FROM PUBLIC;
REVOKE ALL ON TABLE itemcost FROM admin;
GRANT ALL ON TABLE itemcost TO admin;
GRANT ALL ON TABLE itemcost TO xtrole;


--
-- Name: itemfile; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemfile FROM PUBLIC;
REVOKE ALL ON TABLE itemfile FROM admin;
GRANT ALL ON TABLE itemfile TO admin;
GRANT ALL ON TABLE itemfile TO xtrole;


--
-- Name: itemimage; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemimage FROM PUBLIC;
REVOKE ALL ON TABLE itemimage FROM admin;
GRANT ALL ON TABLE itemimage TO admin;
GRANT ALL ON TABLE itemimage TO xtrole;



--
-- Name: costcat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE costcat FROM PUBLIC;
REVOKE ALL ON TABLE costcat FROM admin;
GRANT ALL ON TABLE costcat TO admin;
GRANT ALL ON TABLE costcat TO xtrole;


--
-- Name: plancode; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE plancode FROM PUBLIC;
REVOKE ALL ON TABLE plancode FROM admin;
GRANT ALL ON TABLE plancode TO admin;
GRANT ALL ON TABLE plancode TO xtrole;



--
-- Name: itemsite; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemsite FROM PUBLIC;
REVOKE ALL ON TABLE itemsite FROM admin;
GRANT ALL ON TABLE itemsite TO admin;
GRANT ALL ON TABLE itemsite TO xtrole;


--
-- Name: itemsitecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemsitecomment FROM PUBLIC;
REVOKE ALL ON TABLE itemsitecomment FROM admin;
GRANT ALL ON TABLE itemsitecomment TO admin;
GRANT ALL ON TABLE itemsitecomment TO xtrole;



--
-- Name: contrct; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE contrct FROM PUBLIC;
REVOKE ALL ON TABLE contrct FROM admin;
GRANT ALL ON TABLE contrct TO admin;
GRANT ALL ON TABLE contrct TO xtrole;


--
-- Name: itemsrc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemsrc FROM PUBLIC;
REVOKE ALL ON TABLE itemsrc FROM admin;
GRANT ALL ON TABLE itemsrc TO admin;
GRANT ALL ON TABLE itemsrc TO xtrole;



--
-- Name: itemsource; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemsource FROM PUBLIC;
REVOKE ALL ON TABLE itemsource FROM admin;
GRANT ALL ON TABLE itemsource TO admin;
GRANT ALL ON TABLE itemsource TO xtrole;



--
-- Name: itemsrcp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemsrcp FROM PUBLIC;
REVOKE ALL ON TABLE itemsrcp FROM admin;
GRANT ALL ON TABLE itemsrcp TO admin;
GRANT ALL ON TABLE itemsrcp TO xtrole;



--
-- Name: itemsourceprice; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemsourceprice FROM PUBLIC;
REVOKE ALL ON TABLE itemsourceprice FROM admin;
GRANT ALL ON TABLE itemsourceprice TO admin;
GRANT ALL ON TABLE itemsourceprice TO xtrole;



--
-- Name: itemsub; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemsub FROM PUBLIC;
REVOKE ALL ON TABLE itemsub FROM admin;
GRANT ALL ON TABLE itemsub TO admin;
GRANT ALL ON TABLE itemsub TO xtrole;



--
-- Name: itemsubstitute; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemsubstitute FROM PUBLIC;
REVOKE ALL ON TABLE itemsubstitute FROM admin;
GRANT ALL ON TABLE itemsubstitute TO admin;
GRANT ALL ON TABLE itemsubstitute TO xtrole;



--
-- Name: itemtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemtax FROM PUBLIC;
REVOKE ALL ON TABLE itemtax FROM admin;
GRANT ALL ON TABLE itemtax TO admin;
GRANT ALL ON TABLE itemtax TO xtrole;



--
-- Name: itemtaxtype; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemtaxtype FROM PUBLIC;
REVOKE ALL ON TABLE itemtaxtype FROM admin;
GRANT ALL ON TABLE itemtaxtype TO admin;
GRANT ALL ON TABLE itemtaxtype TO xtrole;



--
-- Name: itemuomconv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemuomconv FROM PUBLIC;
REVOKE ALL ON TABLE itemuomconv FROM admin;
GRANT ALL ON TABLE itemuomconv TO admin;
GRANT ALL ON TABLE itemuomconv TO xtrole;



--
-- Name: itemuomconversion; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE itemuomconversion FROM PUBLIC;
REVOKE ALL ON TABLE itemuomconversion FROM admin;
GRANT ALL ON TABLE itemuomconversion TO admin;
GRANT ALL ON TABLE itemuomconversion TO xtrole;



--
-- Name: gltrans; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE gltrans FROM PUBLIC;
REVOKE ALL ON TABLE gltrans FROM admin;
GRANT ALL ON TABLE gltrans TO admin;
GRANT ALL ON TABLE gltrans TO xtrole;



--
-- Name: journalentry; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE journalentry FROM PUBLIC;
REVOKE ALL ON TABLE journalentry FROM admin;
GRANT ALL ON TABLE journalentry TO admin;
GRANT ALL ON TABLE journalentry TO xtrole;



--
-- Name: location; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE location FROM PUBLIC;
REVOKE ALL ON TABLE location FROM admin;
GRANT ALL ON TABLE location TO admin;
GRANT ALL ON TABLE location TO xtrole;


--
-- Name: whsezone; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE whsezone FROM PUBLIC;
REVOKE ALL ON TABLE whsezone FROM admin;
GRANT ALL ON TABLE whsezone TO admin;
GRANT ALL ON TABLE whsezone TO xtrole;



--
-- Name: location; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE location FROM PUBLIC;
REVOKE ALL ON TABLE location FROM admin;
GRANT ALL ON TABLE location TO admin;
GRANT ALL ON TABLE location TO xtrole;


--
-- Name: misccounttag; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE misccounttag FROM PUBLIC;
REVOKE ALL ON TABLE misccounttag FROM admin;
GRANT ALL ON TABLE misccounttag TO admin;
GRANT ALL ON TABLE misccounttag TO xtrole;


--
-- Name: pricingschedule; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE pricingschedule FROM PUBLIC;
REVOKE ALL ON TABLE pricingschedule FROM admin;
GRANT ALL ON TABLE pricingschedule TO admin;
GRANT ALL ON TABLE pricingschedule TO xtrole;



--
-- Name: ipsass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsass FROM PUBLIC;
REVOKE ALL ON TABLE ipsass FROM admin;
GRANT ALL ON TABLE ipsass TO admin;
GRANT ALL ON TABLE ipsass TO xtrole;



--
-- Name: pricingscheduleassign; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE pricingscheduleassign FROM PUBLIC;
REVOKE ALL ON TABLE pricingscheduleassign FROM admin;
GRANT ALL ON TABLE pricingscheduleassign TO admin;
GRANT ALL ON TABLE pricingscheduleassign TO xtrole;



--
-- Name: ipsiteminfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsiteminfo FROM PUBLIC;
REVOKE ALL ON TABLE ipsiteminfo FROM admin;
GRANT ALL ON TABLE ipsiteminfo TO admin;
GRANT ALL ON TABLE ipsiteminfo TO xtrole;



--
-- Name: pricingscheduleitem; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE pricingscheduleitem FROM PUBLIC;
REVOKE ALL ON TABLE pricingscheduleitem FROM admin;
GRANT ALL ON TABLE pricingscheduleitem TO admin;
GRANT ALL ON TABLE pricingscheduleitem TO xtrole;



--
-- Name: ipsitemchar; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsitemchar FROM PUBLIC;
REVOKE ALL ON TABLE ipsitemchar FROM admin;
GRANT ALL ON TABLE ipsitemchar TO admin;
GRANT ALL ON TABLE ipsitemchar TO xtrole;



--
-- Name: pricingscheduleitemchar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE pricingscheduleitemchar FROM PUBLIC;
REVOKE ALL ON TABLE pricingscheduleitemchar FROM admin;
GRANT ALL ON TABLE pricingscheduleitemchar TO admin;
GRANT ALL ON TABLE pricingscheduleitemchar TO xtrole;


--
-- Name: project; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE project FROM PUBLIC;
REVOKE ALL ON TABLE project FROM admin;
GRANT ALL ON TABLE project TO admin;
GRANT ALL ON TABLE project TO xtrole;


--
-- Name: projectcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE projectcomment FROM PUBLIC;
REVOKE ALL ON TABLE projectcomment FROM admin;
GRANT ALL ON TABLE projectcomment TO admin;
GRANT ALL ON TABLE projectcomment TO xtrole;



--
-- Name: cust_cust_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cust_cust_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cust_cust_id_seq FROM admin;
GRANT ALL ON SEQUENCE cust_cust_id_seq TO admin;
GRANT ALL ON SEQUENCE cust_cust_id_seq TO xtrole;


--
-- Name: prospect; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prospect FROM PUBLIC;
REVOKE ALL ON TABLE prospect FROM admin;
GRANT ALL ON TABLE prospect TO admin;
GRANT ALL ON TABLE prospect TO xtrole;



--
-- Name: prospect; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE prospect FROM PUBLIC;
REVOKE ALL ON TABLE prospect FROM admin;
GRANT ALL ON TABLE prospect TO admin;
GRANT ALL ON TABLE prospect TO xtrole;



--
-- Name: expcat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE expcat FROM PUBLIC;
REVOKE ALL ON TABLE expcat FROM admin;
GRANT ALL ON TABLE expcat TO admin;
GRANT ALL ON TABLE expcat TO xtrole;


--
-- Name: womatl; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE womatl FROM PUBLIC;
REVOKE ALL ON TABLE womatl FROM admin;
GRANT ALL ON TABLE womatl TO admin;
GRANT ALL ON TABLE womatl TO xtrole;



--
-- Name: purchaseline; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE purchaseline FROM PUBLIC;
REVOKE ALL ON TABLE purchaseline FROM admin;
GRANT ALL ON TABLE purchaseline TO admin;
GRANT ALL ON TABLE purchaseline TO xtrole;


--
-- Name: purchaselinechar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE purchaselinechar FROM PUBLIC;
REVOKE ALL ON TABLE purchaselinechar FROM admin;
GRANT ALL ON TABLE purchaselinechar TO admin;
GRANT ALL ON TABLE purchaselinechar TO xtrole;


--
-- Name: purchaselinecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE purchaselinecomment FROM PUBLIC;
REVOKE ALL ON TABLE purchaselinecomment FROM admin;
GRANT ALL ON TABLE purchaselinecomment TO admin;
GRANT ALL ON TABLE purchaselinecomment TO xtrole;



--
-- Name: tax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE tax FROM PUBLIC;
REVOKE ALL ON TABLE tax FROM admin;
GRANT ALL ON TABLE tax TO admin;
GRANT ALL ON TABLE tax TO xtrole;


--
-- Name: vendaddrinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vendaddrinfo FROM PUBLIC;
REVOKE ALL ON TABLE vendaddrinfo FROM admin;
GRANT ALL ON TABLE vendaddrinfo TO admin;
GRANT ALL ON TABLE vendaddrinfo TO xtrole;



--
-- Name: purchaseorder; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE purchaseorder FROM PUBLIC;
REVOKE ALL ON TABLE purchaseorder FROM admin;
GRANT ALL ON TABLE purchaseorder TO admin;
GRANT ALL ON TABLE purchaseorder TO xtrole;


--
-- Name: purchaseordercomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE purchaseordercomment FROM PUBLIC;
REVOKE ALL ON TABLE purchaseordercomment FROM admin;
GRANT ALL ON TABLE purchaseordercomment TO admin;
GRANT ALL ON TABLE purchaseordercomment TO xtrole;



--
-- Name: quhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE quhead FROM PUBLIC;
REVOKE ALL ON TABLE quhead FROM admin;
GRANT ALL ON TABLE quhead TO admin;
GRANT ALL ON TABLE quhead TO xtrole;



--
-- Name: quote; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE quote FROM PUBLIC;
REVOKE ALL ON TABLE quote FROM admin;
GRANT ALL ON TABLE quote TO admin;
GRANT ALL ON TABLE quote TO xtrole;


--
-- Name: quotecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE quotecomment FROM PUBLIC;
REVOKE ALL ON TABLE quotecomment FROM admin;
GRANT ALL ON TABLE quotecomment TO admin;
GRANT ALL ON TABLE quotecomment TO xtrole;



--
-- Name: quitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE quitem FROM PUBLIC;
REVOKE ALL ON TABLE quitem FROM admin;
GRANT ALL ON TABLE quitem TO admin;
GRANT ALL ON TABLE quitem TO xtrole;



--
-- Name: quoteline; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE quoteline FROM PUBLIC;
REVOKE ALL ON TABLE quoteline FROM admin;
GRANT ALL ON TABLE quoteline TO admin;
GRANT ALL ON TABLE quoteline TO xtrole;


--
-- Name: quotelinechar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE quotelinechar FROM PUBLIC;
REVOKE ALL ON TABLE quotelinechar FROM admin;
GRANT ALL ON TABLE quotelinechar TO admin;
GRANT ALL ON TABLE quotelinechar TO xtrole;


--
-- Name: quotelinecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE quotelinecomment FROM PUBLIC;
REVOKE ALL ON TABLE quotelinecomment FROM admin;
GRANT ALL ON TABLE quotelinecomment TO admin;
GRANT ALL ON TABLE quotelinecomment TO xtrole;



--
-- Name: aropenalloc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE aropenalloc FROM PUBLIC;
REVOKE ALL ON TABLE aropenalloc FROM admin;
GRANT ALL ON TABLE aropenalloc TO admin;
GRANT ALL ON TABLE aropenalloc TO xtrole;



--
-- Name: salescredit; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE salescredit FROM PUBLIC;
REVOKE ALL ON TABLE salescredit FROM admin;
GRANT ALL ON TABLE salescredit TO admin;
GRANT ALL ON TABLE salescredit TO xtrole;



--
-- Name: cohist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cohist FROM PUBLIC;
REVOKE ALL ON TABLE cohist FROM admin;
GRANT ALL ON TABLE cohist TO admin;
GRANT ALL ON TABLE cohist TO xtrole;


--
-- Name: taxhist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxhist FROM PUBLIC;
REVOKE ALL ON TABLE taxhist FROM admin;
GRANT ALL ON TABLE taxhist TO admin;
GRANT ALL ON TABLE taxhist TO xtrole;


--
-- Name: cohisttax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cohisttax FROM PUBLIC;
REVOKE ALL ON TABLE cohisttax FROM admin;
GRANT ALL ON TABLE cohisttax TO admin;
GRANT ALL ON TABLE cohisttax TO xtrole;



--
-- Name: saleshistory; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE saleshistory FROM PUBLIC;
REVOKE ALL ON TABLE saleshistory FROM admin;
GRANT ALL ON TABLE saleshistory TO admin;
GRANT ALL ON TABLE saleshistory TO xtrole;


--
-- Name: saleslinechar; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE saleslinechar FROM PUBLIC;
REVOKE ALL ON TABLE saleslinechar FROM admin;
GRANT ALL ON TABLE saleslinechar TO admin;
GRANT ALL ON TABLE saleslinechar TO xtrole;


--
-- Name: saleslinecomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE saleslinecomment FROM PUBLIC;
REVOKE ALL ON TABLE saleslinecomment FROM admin;
GRANT ALL ON TABLE saleslinecomment TO admin;
GRANT ALL ON TABLE saleslinecomment TO xtrole;


--
-- Name: salesorder; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE salesorder FROM PUBLIC;
REVOKE ALL ON TABLE salesorder FROM admin;
GRANT ALL ON TABLE salesorder TO admin;
GRANT ALL ON TABLE salesorder TO xtrole;


--
-- Name: salesordercomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE salesordercomment FROM PUBLIC;
REVOKE ALL ON TABLE salesordercomment FROM admin;
GRANT ALL ON TABLE salesordercomment TO admin;
GRANT ALL ON TABLE salesordercomment TO xtrole;


--
-- Name: salesrep; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE salesrep FROM PUBLIC;
REVOKE ALL ON TABLE salesrep FROM admin;
GRANT ALL ON TABLE salesrep TO admin;
GRANT ALL ON TABLE salesrep TO xtrole;



--
-- Name: shipvia; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipvia FROM PUBLIC;
REVOKE ALL ON TABLE shipvia FROM admin;
GRANT ALL ON TABLE shipvia TO admin;
GRANT ALL ON TABLE shipvia TO xtrole;


--
-- Name: sitetype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sitetype FROM PUBLIC;
REVOKE ALL ON TABLE sitetype FROM admin;
GRANT ALL ON TABLE sitetype TO admin;
GRANT ALL ON TABLE sitetype TO xtrole;



--
-- Name: site; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE site FROM PUBLIC;
REVOKE ALL ON TABLE site FROM admin;
GRANT ALL ON TABLE site TO admin;
GRANT ALL ON TABLE site TO xtrole;


--
-- Name: sitezone; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE sitezone FROM PUBLIC;
REVOKE ALL ON TABLE sitezone FROM admin;
GRANT ALL ON TABLE sitezone TO admin;
GRANT ALL ON TABLE sitezone TO xtrole;


--
-- Name: task; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE task FROM PUBLIC;
REVOKE ALL ON TABLE task FROM admin;
GRANT ALL ON TABLE task TO admin;
GRANT ALL ON TABLE task TO xtrole;


--
-- Name: taskcomment; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE taskcomment FROM PUBLIC;
REVOKE ALL ON TABLE taskcomment FROM admin;
GRANT ALL ON TABLE taskcomment TO admin;
GRANT ALL ON TABLE taskcomment TO xtrole;


--
-- Name: todo; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE todo FROM PUBLIC;
REVOKE ALL ON TABLE todo FROM admin;
GRANT ALL ON TABLE todo TO admin;
GRANT ALL ON TABLE todo TO xtrole;



--
-- Name: vendtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vendtype FROM PUBLIC;
REVOKE ALL ON TABLE vendtype FROM admin;
GRANT ALL ON TABLE vendtype TO admin;
GRANT ALL ON TABLE vendtype TO xtrole;



--
-- Name: vendor; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE vendor FROM PUBLIC;
REVOKE ALL ON TABLE vendor FROM admin;
GRANT ALL ON TABLE vendor TO admin;
GRANT ALL ON TABLE vendor TO xtrole;


--
-- Name: vendoraddress; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE vendoraddress FROM PUBLIC;
REVOKE ALL ON TABLE vendoraddress FROM admin;
GRANT ALL ON TABLE vendoraddress TO admin;
GRANT ALL ON TABLE vendoraddress TO xtrole;


--
-- Name: vendortype; Type: ACL; Schema: api; Owner: admin
--

REVOKE ALL ON TABLE vendortype FROM PUBLIC;
REVOKE ALL ON TABLE vendortype FROM admin;
GRANT ALL ON TABLE vendortype TO admin;
GRANT ALL ON TABLE vendortype TO xtrole;



--
-- Name: cmd; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmd FROM PUBLIC;
REVOKE ALL ON TABLE cmd FROM admin;
GRANT ALL ON TABLE cmd TO admin;
GRANT ALL ON TABLE cmd TO xtrole;


--
-- Name: cmd_cmd_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmd_cmd_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmd_cmd_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmd_cmd_id_seq TO admin;
GRANT ALL ON SEQUENCE cmd_cmd_id_seq TO xtrole;



--
-- Name: pkgcmd; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgcmd FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmd FROM admin;
GRANT ALL ON TABLE pkgcmd TO admin;
GRANT ALL ON TABLE pkgcmd TO xtrole;



--
-- Name: cmdarg; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmdarg FROM PUBLIC;
REVOKE ALL ON TABLE cmdarg FROM admin;
GRANT ALL ON TABLE cmdarg TO admin;
GRANT ALL ON TABLE cmdarg TO xtrole;


--
-- Name: cmdarg_cmdarg_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmdarg_cmdarg_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmdarg_cmdarg_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmdarg_cmdarg_id_seq TO admin;
GRANT ALL ON SEQUENCE cmdarg_cmdarg_id_seq TO xtrole;



--
-- Name: pkgcmdarg; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgcmdarg FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmdarg FROM admin;
GRANT ALL ON TABLE pkgcmdarg TO admin;
GRANT ALL ON TABLE pkgcmdarg TO xtrole;



--
-- Name: image_image_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE image_image_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE image_image_id_seq FROM admin;
GRANT ALL ON SEQUENCE image_image_id_seq TO admin;
GRANT ALL ON SEQUENCE image_image_id_seq TO xtrole;



--
-- Name: pkgimage; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgimage FROM PUBLIC;
REVOKE ALL ON TABLE pkgimage FROM admin;
GRANT ALL ON TABLE pkgimage TO admin;
GRANT ALL ON TABLE pkgimage TO xtrole;



--
-- Name: metasql; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE metasql FROM PUBLIC;
REVOKE ALL ON TABLE metasql FROM admin;
GRANT ALL ON TABLE metasql TO admin;
GRANT ALL ON TABLE metasql TO xtrole;


--
-- Name: metasql_metasql_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE metasql_metasql_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE metasql_metasql_id_seq FROM admin;
GRANT ALL ON SEQUENCE metasql_metasql_id_seq TO admin;
GRANT ALL ON SEQUENCE metasql_metasql_id_seq TO xtrole;



--
-- Name: pkgmetasql; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgmetasql FROM PUBLIC;
REVOKE ALL ON TABLE pkgmetasql FROM admin;
GRANT ALL ON TABLE pkgmetasql TO admin;
GRANT ALL ON TABLE pkgmetasql TO xtrole;



--
-- Name: priv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE priv FROM PUBLIC;
REVOKE ALL ON TABLE priv FROM admin;
GRANT ALL ON TABLE priv TO admin;
GRANT ALL ON TABLE priv TO xtrole;


--
-- Name: priv_priv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE priv_priv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE priv_priv_id_seq FROM admin;
GRANT ALL ON SEQUENCE priv_priv_id_seq TO admin;
GRANT ALL ON SEQUENCE priv_priv_id_seq TO xtrole;



--
-- Name: pkgpriv; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgpriv FROM PUBLIC;
REVOKE ALL ON TABLE pkgpriv FROM admin;
GRANT ALL ON TABLE pkgpriv TO admin;
GRANT ALL ON TABLE pkgpriv TO xtrole;



--
-- Name: report; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE report FROM PUBLIC;
REVOKE ALL ON TABLE report FROM admin;
GRANT ALL ON TABLE report TO admin;
GRANT ALL ON TABLE report TO xtrole;


--
-- Name: report_report_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE report_report_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE report_report_id_seq FROM admin;
GRANT ALL ON SEQUENCE report_report_id_seq TO admin;
GRANT ALL ON SEQUENCE report_report_id_seq TO xtrole;



--
-- Name: pkgreport; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgreport FROM PUBLIC;
REVOKE ALL ON TABLE pkgreport FROM admin;
GRANT ALL ON TABLE pkgreport TO admin;
GRANT ALL ON TABLE pkgreport TO xtrole;



--
-- Name: script; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE script FROM PUBLIC;
REVOKE ALL ON TABLE script FROM admin;
GRANT ALL ON TABLE script TO admin;
GRANT ALL ON TABLE script TO xtrole;


--
-- Name: script_script_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE script_script_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE script_script_id_seq FROM admin;
GRANT ALL ON SEQUENCE script_script_id_seq TO admin;
GRANT ALL ON SEQUENCE script_script_id_seq TO xtrole;



--
-- Name: pkgscript; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkgscript FROM PUBLIC;
REVOKE ALL ON TABLE pkgscript FROM admin;
GRANT ALL ON TABLE pkgscript TO admin;
GRANT ALL ON TABLE pkgscript TO xtrole;



--
-- Name: uiform; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE uiform FROM PUBLIC;
REVOKE ALL ON TABLE uiform FROM admin;
GRANT ALL ON TABLE uiform TO admin;
GRANT ALL ON TABLE uiform TO xtrole;


--
-- Name: uiform_uiform_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE uiform_uiform_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE uiform_uiform_id_seq FROM admin;
GRANT ALL ON SEQUENCE uiform_uiform_id_seq TO admin;
GRANT ALL ON SEQUENCE uiform_uiform_id_seq TO xtrole;



--
-- Name: pkguiform; Type: ACL; Schema: fixcountry; Owner: admin
--

REVOKE ALL ON TABLE pkguiform FROM PUBLIC;
REVOKE ALL ON TABLE pkguiform FROM admin;
GRANT ALL ON TABLE pkguiform TO admin;
GRANT ALL ON TABLE pkguiform TO xtrole;



--
-- Name: acalitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE acalitem FROM PUBLIC;
REVOKE ALL ON TABLE acalitem FROM admin;
GRANT ALL ON TABLE acalitem TO admin;
GRANT ALL ON TABLE acalitem TO xtrole;


--
-- Name: accnt_accnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE accnt_accnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE accnt_accnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE accnt_accnt_id_seq TO admin;
GRANT ALL ON SEQUENCE accnt_accnt_id_seq TO xtrole;


--
-- Name: addr_addr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE addr_addr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE addr_addr_id_seq FROM admin;
GRANT ALL ON SEQUENCE addr_addr_id_seq TO admin;
GRANT ALL ON SEQUENCE addr_addr_id_seq TO xtrole;


--
-- Name: address; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE address FROM PUBLIC;
REVOKE ALL ON TABLE address FROM admin;
GRANT ALL ON TABLE address TO admin;
GRANT ALL ON TABLE address TO xtrole;


--
-- Name: alarm; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE alarm FROM PUBLIC;
REVOKE ALL ON TABLE alarm FROM admin;
GRANT ALL ON TABLE alarm TO admin;
GRANT ALL ON TABLE alarm TO xtrole;


--
-- Name: alarm_alarm_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE alarm_alarm_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE alarm_alarm_id_seq FROM admin;
GRANT ALL ON SEQUENCE alarm_alarm_id_seq TO admin;
GRANT ALL ON SEQUENCE alarm_alarm_id_seq TO xtrole;


--
-- Name: apaccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apaccnt FROM PUBLIC;
REVOKE ALL ON TABLE apaccnt FROM admin;
GRANT ALL ON TABLE apaccnt TO admin;
GRANT ALL ON TABLE apaccnt TO xtrole;


--
-- Name: apaccnt_apaccnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE apaccnt_apaccnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE apaccnt_apaccnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE apaccnt_apaccnt_id_seq TO admin;
GRANT ALL ON SEQUENCE apaccnt_apaccnt_id_seq TO xtrole;


--
-- Name: apapply; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apapply FROM PUBLIC;
REVOKE ALL ON TABLE apapply FROM admin;
GRANT ALL ON TABLE apapply TO admin;
GRANT ALL ON TABLE apapply TO xtrole;


--
-- Name: apapply_apapply_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE apapply_apapply_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE apapply_apapply_id_seq FROM admin;
GRANT ALL ON SEQUENCE apapply_apapply_id_seq TO admin;
GRANT ALL ON SEQUENCE apapply_apapply_id_seq TO xtrole;


--
-- Name: checkhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE checkhead FROM PUBLIC;
REVOKE ALL ON TABLE checkhead FROM admin;
GRANT ALL ON TABLE checkhead TO admin;
GRANT ALL ON TABLE checkhead TO xtrole;


--
-- Name: apchk; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apchk FROM PUBLIC;
REVOKE ALL ON TABLE apchk FROM admin;
GRANT ALL ON TABLE apchk TO admin;
GRANT ALL ON TABLE apchk TO xtrole;


--
-- Name: checkitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE checkitem FROM PUBLIC;
REVOKE ALL ON TABLE checkitem FROM admin;
GRANT ALL ON TABLE checkitem TO admin;
GRANT ALL ON TABLE checkitem TO xtrole;


--
-- Name: apchkitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apchkitem FROM PUBLIC;
REVOKE ALL ON TABLE apchkitem FROM admin;
GRANT ALL ON TABLE apchkitem TO admin;
GRANT ALL ON TABLE apchkitem TO xtrole;


--
-- Name: apcreditapply; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apcreditapply FROM PUBLIC;
REVOKE ALL ON TABLE apcreditapply FROM admin;
GRANT ALL ON TABLE apcreditapply TO admin;
GRANT ALL ON TABLE apcreditapply TO xtrole;


--
-- Name: apcreditapply_apcreditapply_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE apcreditapply_apcreditapply_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE apcreditapply_apcreditapply_id_seq FROM admin;
GRANT ALL ON SEQUENCE apcreditapply_apcreditapply_id_seq TO admin;
GRANT ALL ON SEQUENCE apcreditapply_apcreditapply_id_seq TO xtrole;


--
-- Name: apmemo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apmemo FROM PUBLIC;
REVOKE ALL ON TABLE apmemo FROM admin;
GRANT ALL ON TABLE apmemo TO admin;
GRANT ALL ON TABLE apmemo TO xtrole;


--
-- Name: apopen_apopen_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE apopen_apopen_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE apopen_apopen_id_seq FROM admin;
GRANT ALL ON SEQUENCE apopen_apopen_id_seq TO admin;
GRANT ALL ON SEQUENCE apopen_apopen_id_seq TO xtrole;


--
-- Name: apopentax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apopentax FROM PUBLIC;
REVOKE ALL ON TABLE apopentax FROM admin;
GRANT ALL ON TABLE apopentax TO admin;
GRANT ALL ON TABLE apopentax TO xtrole;


--
-- Name: apselect; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE apselect FROM PUBLIC;
REVOKE ALL ON TABLE apselect FROM admin;
GRANT ALL ON TABLE apselect TO admin;
GRANT ALL ON TABLE apselect TO xtrole;


--
-- Name: apselect_apselect_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE apselect_apselect_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE apselect_apselect_id_seq FROM admin;
GRANT ALL ON SEQUENCE apselect_apselect_id_seq TO admin;
GRANT ALL ON SEQUENCE apselect_apselect_id_seq TO xtrole;


--
-- Name: araccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE araccnt FROM PUBLIC;
REVOKE ALL ON TABLE araccnt FROM admin;
GRANT ALL ON TABLE araccnt TO admin;
GRANT ALL ON TABLE araccnt TO xtrole;


--
-- Name: araccnt_araccnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE araccnt_araccnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE araccnt_araccnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE araccnt_araccnt_id_seq TO admin;
GRANT ALL ON SEQUENCE araccnt_araccnt_id_seq TO xtrole;


--
-- Name: arapply; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE arapply FROM PUBLIC;
REVOKE ALL ON TABLE arapply FROM admin;
GRANT ALL ON TABLE arapply TO admin;
GRANT ALL ON TABLE arapply TO xtrole;


--
-- Name: arapply_arapply_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE arapply_arapply_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE arapply_arapply_id_seq FROM admin;
GRANT ALL ON SEQUENCE arapply_arapply_id_seq TO admin;
GRANT ALL ON SEQUENCE arapply_arapply_id_seq TO xtrole;


--
-- Name: cashrcptitem_cashrcptitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cashrcptitem_cashrcptitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cashrcptitem_cashrcptitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE cashrcptitem_cashrcptitem_id_seq TO admin;
GRANT ALL ON SEQUENCE cashrcptitem_cashrcptitem_id_seq TO xtrole;


--
-- Name: arcreditapply; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE arcreditapply FROM PUBLIC;
REVOKE ALL ON TABLE arcreditapply FROM admin;
GRANT ALL ON TABLE arcreditapply TO admin;
GRANT ALL ON TABLE arcreditapply TO xtrole;


--
-- Name: arcreditapply_arcreditapply_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE arcreditapply_arcreditapply_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE arcreditapply_arcreditapply_id_seq FROM admin;
GRANT ALL ON SEQUENCE arcreditapply_arcreditapply_id_seq TO admin;
GRANT ALL ON SEQUENCE arcreditapply_arcreditapply_id_seq TO xtrole;


--
-- Name: armemo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE armemo FROM PUBLIC;
REVOKE ALL ON TABLE armemo FROM admin;
GRANT ALL ON TABLE armemo TO admin;
GRANT ALL ON TABLE armemo TO xtrole;


--
-- Name: aropen_aropen_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE aropen_aropen_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE aropen_aropen_id_seq FROM admin;
GRANT ALL ON SEQUENCE aropen_aropen_id_seq TO admin;
GRANT ALL ON SEQUENCE aropen_aropen_id_seq TO xtrole;


--
-- Name: aropentax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE aropentax FROM PUBLIC;
REVOKE ALL ON TABLE aropentax FROM admin;
GRANT ALL ON TABLE aropentax TO admin;
GRANT ALL ON TABLE aropentax TO xtrole;


--
-- Name: asohist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE asohist FROM PUBLIC;
REVOKE ALL ON TABLE asohist FROM admin;
GRANT ALL ON TABLE asohist TO admin;
GRANT ALL ON TABLE asohist TO xtrole;


--
-- Name: asohist_asohist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE asohist_asohist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE asohist_asohist_id_seq FROM admin;
GRANT ALL ON SEQUENCE asohist_asohist_id_seq TO admin;
GRANT ALL ON SEQUENCE asohist_asohist_id_seq TO xtrole;


--
-- Name: asohisttax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE asohisttax FROM PUBLIC;
REVOKE ALL ON TABLE asohisttax FROM admin;
GRANT ALL ON TABLE asohisttax TO admin;
GRANT ALL ON TABLE asohisttax TO xtrole;


--
-- Name: atlasmap; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE atlasmap FROM PUBLIC;
REVOKE ALL ON TABLE atlasmap FROM admin;
GRANT ALL ON TABLE atlasmap TO admin;
GRANT ALL ON TABLE atlasmap TO xtrole;


--
-- Name: atlasmap_atlasmap_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE atlasmap_atlasmap_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE atlasmap_atlasmap_id_seq FROM admin;
GRANT ALL ON SEQUENCE atlasmap_atlasmap_id_seq TO admin;
GRANT ALL ON SEQUENCE atlasmap_atlasmap_id_seq TO xtrole;


--
-- Name: backup_usr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE backup_usr FROM PUBLIC;
REVOKE ALL ON TABLE backup_usr FROM admin;
GRANT ALL ON TABLE backup_usr TO admin;
GRANT ALL ON TABLE backup_usr TO xtrole;


--
-- Name: bankaccnt_bankaccnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankaccnt_bankaccnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankaccnt_bankaccnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankaccnt_bankaccnt_id_seq TO admin;
GRANT ALL ON SEQUENCE bankaccnt_bankaccnt_id_seq TO xtrole;


--
-- Name: bankadj; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankadj FROM PUBLIC;
REVOKE ALL ON TABLE bankadj FROM admin;
GRANT ALL ON TABLE bankadj TO admin;
GRANT ALL ON TABLE bankadj TO xtrole;


--
-- Name: bankadj_bankadj_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankadj_bankadj_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankadj_bankadj_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankadj_bankadj_id_seq TO admin;
GRANT ALL ON SEQUENCE bankadj_bankadj_id_seq TO xtrole;


--
-- Name: bankadjtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankadjtype FROM PUBLIC;
REVOKE ALL ON TABLE bankadjtype FROM admin;
GRANT ALL ON TABLE bankadjtype TO admin;
GRANT ALL ON TABLE bankadjtype TO xtrole;


--
-- Name: bankadjtype_bankadjtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankadjtype_bankadjtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankadjtype_bankadjtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankadjtype_bankadjtype_id_seq TO admin;
GRANT ALL ON SEQUENCE bankadjtype_bankadjtype_id_seq TO xtrole;


--
-- Name: bankrec; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankrec FROM PUBLIC;
REVOKE ALL ON TABLE bankrec FROM admin;
GRANT ALL ON TABLE bankrec TO admin;
GRANT ALL ON TABLE bankrec TO xtrole;


--
-- Name: bankrec_bankrec_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankrec_bankrec_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankrec_bankrec_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankrec_bankrec_id_seq TO admin;
GRANT ALL ON SEQUENCE bankrec_bankrec_id_seq TO xtrole;


--
-- Name: bankrecimport; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankrecimport FROM PUBLIC;
REVOKE ALL ON TABLE bankrecimport FROM admin;
GRANT ALL ON TABLE bankrecimport TO admin;
GRANT ALL ON TABLE bankrecimport TO xtrole;


--
-- Name: bankrecimport_bankrecimport_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankrecimport_bankrecimport_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankrecimport_bankrecimport_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankrecimport_bankrecimport_id_seq TO admin;
GRANT ALL ON SEQUENCE bankrecimport_bankrecimport_id_seq TO xtrole;


--
-- Name: bankrecitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bankrecitem FROM PUBLIC;
REVOKE ALL ON TABLE bankrecitem FROM admin;
GRANT ALL ON TABLE bankrecitem TO admin;
GRANT ALL ON TABLE bankrecitem TO xtrole;


--
-- Name: bankrecitem_bankrecitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bankrecitem_bankrecitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bankrecitem_bankrecitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE bankrecitem_bankrecitem_id_seq TO admin;
GRANT ALL ON SEQUENCE bankrecitem_bankrecitem_id_seq TO xtrole;


--
-- Name: bomhead_bomhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bomhead_bomhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bomhead_bomhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE bomhead_bomhead_id_seq TO admin;
GRANT ALL ON SEQUENCE bomhead_bomhead_id_seq TO xtrole;


--
-- Name: bomitem_bomitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bomitem_bomitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bomitem_bomitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE bomitem_bomitem_id_seq TO admin;
GRANT ALL ON SEQUENCE bomitem_bomitem_id_seq TO xtrole;


--
-- Name: bomitemcost; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bomitemcost FROM PUBLIC;
REVOKE ALL ON TABLE bomitemcost FROM admin;
GRANT ALL ON TABLE bomitemcost TO admin;
GRANT ALL ON TABLE bomitemcost TO xtrole;


--
-- Name: bomitemcost_bomitemcost_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bomitemcost_bomitemcost_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bomitemcost_bomitemcost_id_seq FROM admin;
GRANT ALL ON SEQUENCE bomitemcost_bomitemcost_id_seq TO admin;
GRANT ALL ON SEQUENCE bomitemcost_bomitemcost_id_seq TO xtrole;


--
-- Name: bomitemsub_bomitemsub_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bomitemsub_bomitemsub_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bomitemsub_bomitemsub_id_seq FROM admin;
GRANT ALL ON SEQUENCE bomitemsub_bomitemsub_id_seq TO admin;
GRANT ALL ON SEQUENCE bomitemsub_bomitemsub_id_seq TO xtrole;


--
-- Name: bomwork; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE bomwork FROM PUBLIC;
REVOKE ALL ON TABLE bomwork FROM admin;
GRANT ALL ON TABLE bomwork TO admin;
GRANT ALL ON TABLE bomwork TO xtrole;


--
-- Name: bomwork_bomwork_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE bomwork_bomwork_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE bomwork_bomwork_id_seq FROM admin;
GRANT ALL ON SEQUENCE bomwork_bomwork_id_seq TO admin;
GRANT ALL ON SEQUENCE bomwork_bomwork_id_seq TO xtrole;


--
-- Name: budget; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE budget FROM PUBLIC;
REVOKE ALL ON TABLE budget FROM admin;
GRANT ALL ON TABLE budget TO admin;
GRANT ALL ON TABLE budget TO xtrole;


--
-- Name: budghead_budghead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE budghead_budghead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE budghead_budghead_id_seq FROM admin;
GRANT ALL ON SEQUENCE budghead_budghead_id_seq TO admin;
GRANT ALL ON SEQUENCE budghead_budghead_id_seq TO xtrole;


--
-- Name: budgitem_budgitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE budgitem_budgitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE budgitem_budgitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE budgitem_budgitem_id_seq TO admin;
GRANT ALL ON SEQUENCE budgitem_budgitem_id_seq TO xtrole;


--
-- Name: calhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE calhead FROM PUBLIC;
REVOKE ALL ON TABLE calhead FROM admin;
GRANT ALL ON TABLE calhead TO admin;
GRANT ALL ON TABLE calhead TO xtrole;


--
-- Name: calhead_calhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE calhead_calhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE calhead_calhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE calhead_calhead_id_seq TO admin;
GRANT ALL ON SEQUENCE calhead_calhead_id_seq TO xtrole;


--
-- Name: carrier_carrier_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE carrier_carrier_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE carrier_carrier_id_seq FROM admin;
GRANT ALL ON SEQUENCE carrier_carrier_id_seq TO admin;
GRANT ALL ON SEQUENCE carrier_carrier_id_seq TO xtrole;


--
-- Name: cashrcpt_cashrcpt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cashrcpt_cashrcpt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cashrcpt_cashrcpt_id_seq FROM admin;
GRANT ALL ON SEQUENCE cashrcpt_cashrcpt_id_seq TO admin;
GRANT ALL ON SEQUENCE cashrcpt_cashrcpt_id_seq TO xtrole;


--
-- Name: cashrcptmisc_cashrcptmisc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cashrcptmisc_cashrcptmisc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cashrcptmisc_cashrcptmisc_id_seq FROM admin;
GRANT ALL ON SEQUENCE cashrcptmisc_cashrcptmisc_id_seq TO admin;
GRANT ALL ON SEQUENCE cashrcptmisc_cashrcptmisc_id_seq TO xtrole;


--
-- Name: ccard_ccard_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ccard_ccard_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ccard_ccard_id_seq FROM admin;
GRANT ALL ON SEQUENCE ccard_ccard_id_seq TO admin;
GRANT ALL ON SEQUENCE ccard_ccard_id_seq TO xtrole;


--
-- Name: ccardaud; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ccardaud FROM PUBLIC;
REVOKE ALL ON TABLE ccardaud FROM admin;
GRANT ALL ON TABLE ccardaud TO admin;
GRANT ALL ON TABLE ccardaud TO xtrole;


--
-- Name: ccardaud_ccardaud_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ccardaud_ccardaud_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ccardaud_ccardaud_id_seq FROM admin;
GRANT ALL ON SEQUENCE ccardaud_ccardaud_id_seq TO admin;
GRANT ALL ON SEQUENCE ccardaud_ccardaud_id_seq TO xtrole;


--
-- Name: ccbank; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ccbank FROM PUBLIC;
REVOKE ALL ON TABLE ccbank FROM admin;
GRANT ALL ON TABLE ccbank TO admin;
GRANT ALL ON TABLE ccbank TO xtrole;


--
-- Name: ccbank_ccbank_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ccbank_ccbank_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ccbank_ccbank_id_seq FROM admin;
GRANT ALL ON SEQUENCE ccbank_ccbank_id_seq TO admin;
GRANT ALL ON SEQUENCE ccbank_ccbank_id_seq TO xtrole;


--
-- Name: ccpay; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ccpay FROM PUBLIC;
REVOKE ALL ON TABLE ccpay FROM admin;
GRANT ALL ON TABLE ccpay TO admin;
GRANT ALL ON TABLE ccpay TO xtrole;


--
-- Name: ccpay_ccpay_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ccpay_ccpay_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ccpay_ccpay_id_seq FROM admin;
GRANT ALL ON SEQUENCE ccpay_ccpay_id_seq TO admin;
GRANT ALL ON SEQUENCE ccpay_ccpay_id_seq TO xtrole;


--
-- Name: char_char_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE char_char_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE char_char_id_seq FROM admin;
GRANT ALL ON SEQUENCE char_char_id_seq TO admin;
GRANT ALL ON SEQUENCE char_char_id_seq TO xtrole;


--
-- Name: charass_charass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE charass_charass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE charass_charass_id_seq FROM admin;
GRANT ALL ON SEQUENCE charass_charass_id_seq TO admin;
GRANT ALL ON SEQUENCE charass_charass_id_seq TO xtrole;


--
-- Name: charopt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE charopt FROM PUBLIC;
REVOKE ALL ON TABLE charopt FROM admin;
GRANT ALL ON TABLE charopt TO admin;
GRANT ALL ON TABLE charopt TO xtrole;


--
-- Name: charopt_charopt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE charopt_charopt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE charopt_charopt_id_seq FROM admin;
GRANT ALL ON SEQUENCE charopt_charopt_id_seq TO admin;
GRANT ALL ON SEQUENCE charopt_charopt_id_seq TO xtrole;


--
-- Name: charuse; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE charuse FROM PUBLIC;
REVOKE ALL ON TABLE charuse FROM admin;
GRANT ALL ON TABLE charuse TO admin;
GRANT ALL ON TABLE charuse TO xtrole;


--
-- Name: charuse_charuse_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE charuse_charuse_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE charuse_charuse_id_seq FROM admin;
GRANT ALL ON SEQUENCE charuse_charuse_id_seq TO admin;
GRANT ALL ON SEQUENCE charuse_charuse_id_seq TO xtrole;


--
-- Name: checkhead_checkhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE checkhead_checkhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE checkhead_checkhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE checkhead_checkhead_id_seq TO admin;
GRANT ALL ON SEQUENCE checkhead_checkhead_id_seq TO xtrole;


--
-- Name: checkitem_checkitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE checkitem_checkitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE checkitem_checkitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE checkitem_checkitem_id_seq TO admin;
GRANT ALL ON SEQUENCE checkitem_checkitem_id_seq TO xtrole;


--
-- Name: checkrecip; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE checkrecip FROM PUBLIC;
REVOKE ALL ON TABLE checkrecip FROM admin;
GRANT ALL ON TABLE checkrecip TO admin;
GRANT ALL ON TABLE checkrecip TO xtrole;


--
-- Name: classcode_classcode_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE classcode_classcode_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE classcode_classcode_id_seq FROM admin;
GRANT ALL ON SEQUENCE classcode_classcode_id_seq TO admin;
GRANT ALL ON SEQUENCE classcode_classcode_id_seq TO xtrole;


--
-- Name: cmhead_cmhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmhead_cmhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmhead_cmhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmhead_cmhead_id_seq TO admin;
GRANT ALL ON SEQUENCE cmhead_cmhead_id_seq TO xtrole;


--
-- Name: cmheadtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmheadtax FROM PUBLIC;
REVOKE ALL ON TABLE cmheadtax FROM admin;
GRANT ALL ON TABLE cmheadtax TO admin;
GRANT ALL ON TABLE cmheadtax TO xtrole;


--
-- Name: cmitem_cmitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmitem_cmitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmitem_cmitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmitem_cmitem_id_seq TO admin;
GRANT ALL ON SEQUENCE cmitem_cmitem_id_seq TO xtrole;


--
-- Name: cmitemtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmitemtax FROM PUBLIC;
REVOKE ALL ON TABLE cmitemtax FROM admin;
GRANT ALL ON TABLE cmitemtax TO admin;
GRANT ALL ON TABLE cmitemtax TO xtrole;


--
-- Name: cmnttype_cmnttype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmnttype_cmnttype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmnttype_cmnttype_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmnttype_cmnttype_id_seq TO admin;
GRANT ALL ON SEQUENCE cmnttype_cmnttype_id_seq TO xtrole;


--
-- Name: cmnttypesource; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cmnttypesource FROM PUBLIC;
REVOKE ALL ON TABLE cmnttypesource FROM admin;
GRANT ALL ON TABLE cmnttypesource TO admin;
GRANT ALL ON TABLE cmnttypesource TO xtrole;


--
-- Name: cmnttypesource_cmnttypesource_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cmnttypesource_cmnttypesource_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cmnttypesource_cmnttypesource_id_seq FROM admin;
GRANT ALL ON SEQUENCE cmnttypesource_cmnttypesource_id_seq TO admin;
GRANT ALL ON SEQUENCE cmnttypesource_cmnttypesource_id_seq TO xtrole;


--
-- Name: cntct_cntct_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cntct_cntct_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cntct_cntct_id_seq FROM admin;
GRANT ALL ON SEQUENCE cntct_cntct_id_seq TO admin;
GRANT ALL ON SEQUENCE cntct_cntct_id_seq TO xtrole;


--
-- Name: cntctaddr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntctaddr FROM PUBLIC;
REVOKE ALL ON TABLE cntctaddr FROM admin;
GRANT ALL ON TABLE cntctaddr TO admin;
GRANT ALL ON TABLE cntctaddr TO xtrole;


--
-- Name: cntctaddr_cntctaddr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cntctaddr_cntctaddr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cntctaddr_cntctaddr_id_seq FROM admin;
GRANT ALL ON SEQUENCE cntctaddr_cntctaddr_id_seq TO admin;
GRANT ALL ON SEQUENCE cntctaddr_cntctaddr_id_seq TO xtrole;


--
-- Name: cntctdata; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntctdata FROM PUBLIC;
REVOKE ALL ON TABLE cntctdata FROM admin;
GRANT ALL ON TABLE cntctdata TO admin;
GRANT ALL ON TABLE cntctdata TO xtrole;


--
-- Name: cntctdata_cntctdata_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cntctdata_cntctdata_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cntctdata_cntctdata_id_seq FROM admin;
GRANT ALL ON SEQUENCE cntctdata_cntctdata_id_seq TO admin;
GRANT ALL ON SEQUENCE cntctdata_cntctdata_id_seq TO xtrole;


--
-- Name: cntcteml; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntcteml FROM PUBLIC;
REVOKE ALL ON TABLE cntcteml FROM admin;
GRANT ALL ON TABLE cntcteml TO admin;
GRANT ALL ON TABLE cntcteml TO xtrole;


--
-- Name: cntcteml_cntcteml_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cntcteml_cntcteml_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cntcteml_cntcteml_id_seq FROM admin;
GRANT ALL ON SEQUENCE cntcteml_cntcteml_id_seq TO admin;
GRANT ALL ON SEQUENCE cntcteml_cntcteml_id_seq TO xtrole;


--
-- Name: cntctmrgd; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntctmrgd FROM PUBLIC;
REVOKE ALL ON TABLE cntctmrgd FROM admin;
GRANT ALL ON TABLE cntctmrgd TO admin;
GRANT ALL ON TABLE cntctmrgd TO xtrole;


--
-- Name: cntctsel; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cntctsel FROM PUBLIC;
REVOKE ALL ON TABLE cntctsel FROM admin;
GRANT ALL ON TABLE cntctsel TO admin;
GRANT ALL ON TABLE cntctsel TO xtrole;


--
-- Name: cntslip_cntslip_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cntslip_cntslip_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cntslip_cntslip_id_seq FROM admin;
GRANT ALL ON SEQUENCE cntslip_cntslip_id_seq TO admin;
GRANT ALL ON SEQUENCE cntslip_cntslip_id_seq TO xtrole;


--
-- Name: cobill; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cobill FROM PUBLIC;
REVOKE ALL ON TABLE cobill FROM admin;
GRANT ALL ON TABLE cobill TO admin;
GRANT ALL ON TABLE cobill TO xtrole;


--
-- Name: cobill_cobill_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cobill_cobill_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cobill_cobill_id_seq FROM admin;
GRANT ALL ON SEQUENCE cobill_cobill_id_seq TO admin;
GRANT ALL ON SEQUENCE cobill_cobill_id_seq TO xtrole;


--
-- Name: cobilltax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cobilltax FROM PUBLIC;
REVOKE ALL ON TABLE cobilltax FROM admin;
GRANT ALL ON TABLE cobilltax TO admin;
GRANT ALL ON TABLE cobilltax TO xtrole;


--
-- Name: cobmisc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cobmisc FROM PUBLIC;
REVOKE ALL ON TABLE cobmisc FROM admin;
GRANT ALL ON TABLE cobmisc TO admin;
GRANT ALL ON TABLE cobmisc TO xtrole;


--
-- Name: cobmisc_cobmisc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cobmisc_cobmisc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cobmisc_cobmisc_id_seq FROM admin;
GRANT ALL ON SEQUENCE cobmisc_cobmisc_id_seq TO admin;
GRANT ALL ON SEQUENCE cobmisc_cobmisc_id_seq TO xtrole;


--
-- Name: cobmisctax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cobmisctax FROM PUBLIC;
REVOKE ALL ON TABLE cobmisctax FROM admin;
GRANT ALL ON TABLE cobmisctax TO admin;
GRANT ALL ON TABLE cobmisctax TO xtrole;


--
-- Name: cohead_cohead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cohead_cohead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cohead_cohead_id_seq FROM admin;
GRANT ALL ON SEQUENCE cohead_cohead_id_seq TO admin;
GRANT ALL ON SEQUENCE cohead_cohead_id_seq TO xtrole;


--
-- Name: cohist_cohist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cohist_cohist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cohist_cohist_id_seq FROM admin;
GRANT ALL ON SEQUENCE cohist_cohist_id_seq TO admin;
GRANT ALL ON SEQUENCE cohist_cohist_id_seq TO xtrole;


--
-- Name: coitem_coitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE coitem_coitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE coitem_coitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE coitem_coitem_id_seq TO admin;
GRANT ALL ON SEQUENCE coitem_coitem_id_seq TO xtrole;


--
-- Name: comment_comment_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE comment_comment_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE comment_comment_id_seq FROM admin;
GRANT ALL ON SEQUENCE comment_comment_id_seq TO admin;
GRANT ALL ON SEQUENCE comment_comment_id_seq TO xtrole;


--
-- Name: company; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE company FROM PUBLIC;
REVOKE ALL ON TABLE company FROM admin;
GRANT ALL ON TABLE company TO admin;
GRANT ALL ON TABLE company TO xtrole;


--
-- Name: company_company_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE company_company_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE company_company_id_seq FROM admin;
GRANT ALL ON SEQUENCE company_company_id_seq TO admin;
GRANT ALL ON SEQUENCE company_company_id_seq TO xtrole;


--
-- Name: contrct_contrct_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE contrct_contrct_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE contrct_contrct_id_seq FROM admin;
GRANT ALL ON SEQUENCE contrct_contrct_id_seq TO admin;
GRANT ALL ON SEQUENCE contrct_contrct_id_seq TO xtrole;


--
-- Name: shiphead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shiphead FROM PUBLIC;
REVOKE ALL ON TABLE shiphead FROM admin;
GRANT ALL ON TABLE shiphead TO admin;
GRANT ALL ON TABLE shiphead TO xtrole;


--
-- Name: shipitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipitem FROM PUBLIC;
REVOKE ALL ON TABLE shipitem FROM admin;
GRANT ALL ON TABLE shipitem TO admin;
GRANT ALL ON TABLE shipitem TO xtrole;


--
-- Name: coship; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE coship FROM PUBLIC;
REVOKE ALL ON TABLE coship FROM admin;
GRANT ALL ON TABLE coship TO admin;
GRANT ALL ON TABLE coship TO xtrole;


--
-- Name: coship_coship_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE coship_coship_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE coship_coship_id_seq FROM admin;
GRANT ALL ON SEQUENCE coship_coship_id_seq TO admin;
GRANT ALL ON SEQUENCE coship_coship_id_seq TO xtrole;


--
-- Name: cosmisc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cosmisc FROM PUBLIC;
REVOKE ALL ON TABLE cosmisc FROM admin;
GRANT ALL ON TABLE cosmisc TO admin;
GRANT ALL ON TABLE cosmisc TO xtrole;


--
-- Name: cosmisc_cosmisc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cosmisc_cosmisc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cosmisc_cosmisc_id_seq FROM admin;
GRANT ALL ON SEQUENCE cosmisc_cosmisc_id_seq TO admin;
GRANT ALL ON SEQUENCE cosmisc_cosmisc_id_seq TO xtrole;


--
-- Name: cosrc_cosrc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cosrc_cosrc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cosrc_cosrc_id_seq FROM admin;
GRANT ALL ON SEQUENCE cosrc_cosrc_id_seq TO admin;
GRANT ALL ON SEQUENCE cosrc_cosrc_id_seq TO xtrole;


--
-- Name: costcat_costcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE costcat_costcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE costcat_costcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE costcat_costcat_id_seq TO admin;
GRANT ALL ON SEQUENCE costcat_costcat_id_seq TO xtrole;


--
-- Name: costelem_costelem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE costelem_costelem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE costelem_costelem_id_seq FROM admin;
GRANT ALL ON SEQUENCE costelem_costelem_id_seq TO admin;
GRANT ALL ON SEQUENCE costelem_costelem_id_seq TO xtrole;


--
-- Name: costhist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE costhist FROM PUBLIC;
REVOKE ALL ON TABLE costhist FROM admin;
GRANT ALL ON TABLE costhist TO admin;
GRANT ALL ON TABLE costhist TO xtrole;


--
-- Name: costhist_costhist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE costhist_costhist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE costhist_costhist_id_seq FROM admin;
GRANT ALL ON SEQUENCE costhist_costhist_id_seq TO admin;
GRANT ALL ON SEQUENCE costhist_costhist_id_seq TO xtrole;


--
-- Name: costupdate; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE costupdate FROM PUBLIC;
REVOKE ALL ON TABLE costupdate FROM admin;
GRANT ALL ON TABLE costupdate TO admin;
GRANT ALL ON TABLE costupdate TO xtrole;


--
-- Name: country; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE country FROM PUBLIC;
REVOKE ALL ON TABLE country FROM admin;
GRANT ALL ON TABLE country TO admin;
GRANT ALL ON TABLE country TO xtrole;


--
-- Name: country_country_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE country_country_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE country_country_id_seq FROM admin;
GRANT ALL ON SEQUENCE country_country_id_seq TO admin;
GRANT ALL ON SEQUENCE country_country_id_seq TO xtrole;


--
-- Name: salesaccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE salesaccnt FROM PUBLIC;
REVOKE ALL ON TABLE salesaccnt FROM admin;
GRANT ALL ON TABLE salesaccnt TO admin;
GRANT ALL ON TABLE salesaccnt TO xtrole;


--
-- Name: creditmemoeditlist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE creditmemoeditlist FROM PUBLIC;
REVOKE ALL ON TABLE creditmemoeditlist FROM admin;
GRANT ALL ON TABLE creditmemoeditlist TO admin;
GRANT ALL ON TABLE creditmemoeditlist TO xtrole;


--
-- Name: creditmemoitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE creditmemoitem FROM PUBLIC;
REVOKE ALL ON TABLE creditmemoitem FROM admin;
GRANT ALL ON TABLE creditmemoitem TO admin;
GRANT ALL ON TABLE creditmemoitem TO xtrole;


--
-- Name: crmacct_crmacct_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE crmacct_crmacct_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE crmacct_crmacct_id_seq FROM admin;
GRANT ALL ON SEQUENCE crmacct_crmacct_id_seq TO admin;
GRANT ALL ON SEQUENCE crmacct_crmacct_id_seq TO xtrole;


--
-- Name: crmacctsel; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE crmacctsel FROM PUBLIC;
REVOKE ALL ON TABLE crmacctsel FROM admin;
GRANT ALL ON TABLE crmacctsel TO admin;
GRANT ALL ON TABLE crmacctsel TO xtrole;


--
-- Name: curr_rate; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE curr_rate FROM PUBLIC;
REVOKE ALL ON TABLE curr_rate FROM admin;
GRANT ALL ON TABLE curr_rate TO admin;
GRANT ALL ON TABLE curr_rate TO xtrole;


--
-- Name: curr_rate_curr_rate_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE curr_rate_curr_rate_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE curr_rate_curr_rate_id_seq FROM admin;
GRANT ALL ON SEQUENCE curr_rate_curr_rate_id_seq TO admin;
GRANT ALL ON SEQUENCE curr_rate_curr_rate_id_seq TO xtrole;


--
-- Name: curr_symbol_curr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE curr_symbol_curr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE curr_symbol_curr_id_seq FROM admin;
GRANT ALL ON SEQUENCE curr_symbol_curr_id_seq TO admin;
GRANT ALL ON SEQUENCE curr_symbol_curr_id_seq TO xtrole;


--
-- Name: cust; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE cust FROM PUBLIC;
REVOKE ALL ON TABLE cust FROM admin;
GRANT ALL ON TABLE cust TO admin;
GRANT ALL ON TABLE cust TO xtrole;


--
-- Name: cust_serial_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE cust_serial_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE cust_serial_seq FROM admin;
GRANT ALL ON SEQUENCE cust_serial_seq TO admin;
GRANT ALL ON SEQUENCE cust_serial_seq TO xtrole;


--
-- Name: custform; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE custform FROM PUBLIC;
REVOKE ALL ON TABLE custform FROM admin;
GRANT ALL ON TABLE custform TO admin;
GRANT ALL ON TABLE custform TO xtrole;


--
-- Name: custform_custform_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE custform_custform_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE custform_custform_id_seq FROM admin;
GRANT ALL ON SEQUENCE custform_custform_id_seq TO admin;
GRANT ALL ON SEQUENCE custform_custform_id_seq TO xtrole;


--
-- Name: custgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE custgrp FROM PUBLIC;
REVOKE ALL ON TABLE custgrp FROM admin;
GRANT ALL ON TABLE custgrp TO admin;
GRANT ALL ON TABLE custgrp TO xtrole;


--
-- Name: custgrp_custgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE custgrp_custgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE custgrp_custgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE custgrp_custgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE custgrp_custgrp_id_seq TO xtrole;


--
-- Name: custgrpitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE custgrpitem FROM PUBLIC;
REVOKE ALL ON TABLE custgrpitem FROM admin;
GRANT ALL ON TABLE custgrpitem TO admin;
GRANT ALL ON TABLE custgrpitem TO xtrole;


--
-- Name: custgrpitem_custgrpitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE custgrpitem_custgrpitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE custgrpitem_custgrpitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE custgrpitem_custgrpitem_id_seq TO admin;
GRANT ALL ON SEQUENCE custgrpitem_custgrpitem_id_seq TO xtrole;


--
-- Name: custtype_custtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE custtype_custtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE custtype_custtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE custtype_custtype_id_seq TO admin;
GRANT ALL ON SEQUENCE custtype_custtype_id_seq TO xtrole;


--
-- Name: dept_dept_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE dept_dept_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE dept_dept_id_seq FROM admin;
GRANT ALL ON SEQUENCE dept_dept_id_seq TO admin;
GRANT ALL ON SEQUENCE dept_dept_id_seq TO xtrole;


--
-- Name: destination; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE destination FROM PUBLIC;
REVOKE ALL ON TABLE destination FROM admin;
GRANT ALL ON TABLE destination TO admin;
GRANT ALL ON TABLE destination TO xtrole;


--
-- Name: destination_destination_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE destination_destination_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE destination_destination_id_seq FROM admin;
GRANT ALL ON SEQUENCE destination_destination_id_seq TO admin;
GRANT ALL ON SEQUENCE destination_destination_id_seq TO xtrole;


--
-- Name: docinfo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE docinfo FROM PUBLIC;
REVOKE ALL ON TABLE docinfo FROM admin;
GRANT ALL ON TABLE docinfo TO admin;
GRANT ALL ON TABLE docinfo TO xtrole;


--
-- Name: emp_emp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE emp_emp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE emp_emp_id_seq FROM admin;
GRANT ALL ON SEQUENCE emp_emp_id_seq TO admin;
GRANT ALL ON SEQUENCE emp_emp_id_seq TO xtrole;


--
-- Name: empgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE empgrp FROM PUBLIC;
REVOKE ALL ON TABLE empgrp FROM admin;
GRANT ALL ON TABLE empgrp TO admin;
GRANT ALL ON TABLE empgrp TO xtrole;


--
-- Name: empgrp_empgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE empgrp_empgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE empgrp_empgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE empgrp_empgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE empgrp_empgrp_id_seq TO xtrole;


--
-- Name: empgrpitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE empgrpitem FROM PUBLIC;
REVOKE ALL ON TABLE empgrpitem FROM admin;
GRANT ALL ON TABLE empgrpitem TO admin;
GRANT ALL ON TABLE empgrpitem TO xtrole;


--
-- Name: empgrpitem_empgrpitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE empgrpitem_empgrpitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE empgrpitem_empgrpitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE empgrpitem_empgrpitem_id_seq TO admin;
GRANT ALL ON SEQUENCE empgrpitem_empgrpitem_id_seq TO xtrole;


--
-- Name: evntlog; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE evntlog FROM PUBLIC;
REVOKE ALL ON TABLE evntlog FROM admin;
GRANT ALL ON TABLE evntlog TO admin;
GRANT ALL ON TABLE evntlog TO xtrole;


--
-- Name: evntlog_evntlog_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE evntlog_evntlog_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE evntlog_evntlog_id_seq FROM admin;
GRANT ALL ON SEQUENCE evntlog_evntlog_id_seq TO admin;
GRANT ALL ON SEQUENCE evntlog_evntlog_id_seq TO xtrole;


--
-- Name: evntnot; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE evntnot FROM PUBLIC;
REVOKE ALL ON TABLE evntnot FROM admin;
GRANT ALL ON TABLE evntnot TO admin;
GRANT ALL ON TABLE evntnot TO xtrole;


--
-- Name: evntnot_evntnot_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE evntnot_evntnot_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE evntnot_evntnot_id_seq FROM admin;
GRANT ALL ON SEQUENCE evntnot_evntnot_id_seq TO admin;
GRANT ALL ON SEQUENCE evntnot_evntnot_id_seq TO xtrole;


--
-- Name: evnttype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE evnttype FROM PUBLIC;
REVOKE ALL ON TABLE evnttype FROM admin;
GRANT ALL ON TABLE evnttype TO admin;
GRANT ALL ON TABLE evnttype TO xtrole;


--
-- Name: evnttype_evnttype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE evnttype_evnttype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE evnttype_evnttype_id_seq FROM admin;
GRANT ALL ON SEQUENCE evnttype_evnttype_id_seq TO admin;
GRANT ALL ON SEQUENCE evnttype_evnttype_id_seq TO xtrole;


--
-- Name: expcat_expcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE expcat_expcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE expcat_expcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE expcat_expcat_id_seq TO admin;
GRANT ALL ON SEQUENCE expcat_expcat_id_seq TO xtrole;


--
-- Name: file_file_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE file_file_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE file_file_id_seq FROM admin;
GRANT ALL ON SEQUENCE file_file_id_seq TO admin;
GRANT ALL ON SEQUENCE file_file_id_seq TO xtrole;


--
-- Name: filter; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE filter FROM PUBLIC;
REVOKE ALL ON TABLE filter FROM admin;
GRANT ALL ON TABLE filter TO admin;
GRANT ALL ON TABLE filter TO xtrole;


--
-- Name: filter_filter_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE filter_filter_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE filter_filter_id_seq FROM admin;
GRANT ALL ON SEQUENCE filter_filter_id_seq TO admin;
GRANT ALL ON SEQUENCE filter_filter_id_seq TO xtrole;


--
-- Name: fincharg; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE fincharg FROM PUBLIC;
REVOKE ALL ON TABLE fincharg FROM admin;
GRANT ALL ON TABLE fincharg TO admin;
GRANT ALL ON TABLE fincharg TO xtrole;


--
-- Name: fincharg_fincharg_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE fincharg_fincharg_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE fincharg_fincharg_id_seq FROM admin;
GRANT ALL ON SEQUENCE fincharg_fincharg_id_seq TO admin;
GRANT ALL ON SEQUENCE fincharg_fincharg_id_seq TO xtrole;


--
-- Name: flhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flhead FROM PUBLIC;
REVOKE ALL ON TABLE flhead FROM admin;
GRANT ALL ON TABLE flhead TO admin;
GRANT ALL ON TABLE flhead TO xtrole;


--
-- Name: flitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flitem FROM PUBLIC;
REVOKE ALL ON TABLE flitem FROM admin;
GRANT ALL ON TABLE flitem TO admin;
GRANT ALL ON TABLE flitem TO xtrole;


--
-- Name: flaccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flaccnt FROM PUBLIC;
REVOKE ALL ON TABLE flaccnt FROM admin;
GRANT ALL ON TABLE flaccnt TO admin;
GRANT ALL ON TABLE flaccnt TO xtrole;


--
-- Name: flcol; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flcol FROM PUBLIC;
REVOKE ALL ON TABLE flcol FROM admin;
GRANT ALL ON TABLE flcol TO admin;
GRANT ALL ON TABLE flcol TO xtrole;


--
-- Name: flcol_flcol_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flcol_flcol_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flcol_flcol_id_seq FROM admin;
GRANT ALL ON SEQUENCE flcol_flcol_id_seq TO admin;
GRANT ALL ON SEQUENCE flcol_flcol_id_seq TO xtrole;


--
-- Name: flgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flgrp FROM PUBLIC;
REVOKE ALL ON TABLE flgrp FROM admin;
GRANT ALL ON TABLE flgrp TO admin;
GRANT ALL ON TABLE flgrp TO xtrole;


--
-- Name: flgrp_flgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flgrp_flgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flgrp_flgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE flgrp_flgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE flgrp_flgrp_id_seq TO xtrole;


--
-- Name: flhead_flhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flhead_flhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flhead_flhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE flhead_flhead_id_seq TO admin;
GRANT ALL ON SEQUENCE flhead_flhead_id_seq TO xtrole;


--
-- Name: flitem_flitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flitem_flitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flitem_flitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE flitem_flitem_id_seq TO admin;
GRANT ALL ON SEQUENCE flitem_flitem_id_seq TO xtrole;


--
-- Name: flnotes; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flnotes FROM PUBLIC;
REVOKE ALL ON TABLE flnotes FROM admin;
GRANT ALL ON TABLE flnotes TO admin;
GRANT ALL ON TABLE flnotes TO xtrole;


--
-- Name: flnotes_flnotes_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flnotes_flnotes_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flnotes_flnotes_id_seq FROM admin;
GRANT ALL ON SEQUENCE flnotes_flnotes_id_seq TO admin;
GRANT ALL ON SEQUENCE flnotes_flnotes_id_seq TO xtrole;


--
-- Name: flrpt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flrpt FROM PUBLIC;
REVOKE ALL ON TABLE flrpt FROM admin;
GRANT ALL ON TABLE flrpt TO admin;
GRANT ALL ON TABLE flrpt TO xtrole;


--
-- Name: flrpt_flrpt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flrpt_flrpt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flrpt_flrpt_id_seq FROM admin;
GRANT ALL ON SEQUENCE flrpt_flrpt_id_seq TO admin;
GRANT ALL ON SEQUENCE flrpt_flrpt_id_seq TO xtrole;


--
-- Name: flspec; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE flspec FROM PUBLIC;
REVOKE ALL ON TABLE flspec FROM admin;
GRANT ALL ON TABLE flspec TO admin;
GRANT ALL ON TABLE flspec TO xtrole;


--
-- Name: flspec_flspec_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE flspec_flspec_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE flspec_flspec_id_seq FROM admin;
GRANT ALL ON SEQUENCE flspec_flspec_id_seq TO admin;
GRANT ALL ON SEQUENCE flspec_flspec_id_seq TO xtrole;


--
-- Name: form; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE form FROM PUBLIC;
REVOKE ALL ON TABLE form FROM admin;
GRANT ALL ON TABLE form TO admin;
GRANT ALL ON TABLE form TO xtrole;


--
-- Name: form_form_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE form_form_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE form_form_id_seq FROM admin;
GRANT ALL ON SEQUENCE form_form_id_seq TO admin;
GRANT ALL ON SEQUENCE form_form_id_seq TO xtrole;


--
-- Name: freightclass_freightclass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE freightclass_freightclass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE freightclass_freightclass_id_seq FROM admin;
GRANT ALL ON SEQUENCE freightclass_freightclass_id_seq TO admin;
GRANT ALL ON SEQUENCE freightclass_freightclass_id_seq TO xtrole;


--
-- Name: glseries; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE glseries FROM PUBLIC;
REVOKE ALL ON TABLE glseries FROM admin;
GRANT ALL ON TABLE glseries TO admin;
GRANT ALL ON TABLE glseries TO xtrole;


--
-- Name: glseries_glseries_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE glseries_glseries_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE glseries_glseries_id_seq FROM admin;
GRANT ALL ON SEQUENCE glseries_glseries_id_seq TO admin;
GRANT ALL ON SEQUENCE glseries_glseries_id_seq TO xtrole;


--
-- Name: gltrans_gltrans_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE gltrans_gltrans_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE gltrans_gltrans_id_seq FROM admin;
GRANT ALL ON SEQUENCE gltrans_gltrans_id_seq TO admin;
GRANT ALL ON SEQUENCE gltrans_gltrans_id_seq TO xtrole;


--
-- Name: gltrans_sequence_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE gltrans_sequence_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE gltrans_sequence_seq FROM admin;
GRANT ALL ON SEQUENCE gltrans_sequence_seq TO admin;
GRANT ALL ON SEQUENCE gltrans_sequence_seq TO xtrole;


--
-- Name: grp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE grp FROM PUBLIC;
REVOKE ALL ON TABLE grp FROM admin;
GRANT ALL ON TABLE grp TO admin;
GRANT ALL ON TABLE grp TO xtrole;


--
-- Name: grp_grp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE grp_grp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE grp_grp_id_seq FROM admin;
GRANT ALL ON SEQUENCE grp_grp_id_seq TO admin;
GRANT ALL ON SEQUENCE grp_grp_id_seq TO xtrole;


--
-- Name: grppriv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE grppriv FROM PUBLIC;
REVOKE ALL ON TABLE grppriv FROM admin;
GRANT ALL ON TABLE grppriv TO admin;
GRANT ALL ON TABLE grppriv TO xtrole;


--
-- Name: grppriv_grppriv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE grppriv_grppriv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE grppriv_grppriv_id_seq FROM admin;
GRANT ALL ON SEQUENCE grppriv_grppriv_id_seq TO admin;
GRANT ALL ON SEQUENCE grppriv_grppriv_id_seq TO xtrole;


--
-- Name: hnfc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE hnfc FROM PUBLIC;
REVOKE ALL ON TABLE hnfc FROM admin;
GRANT ALL ON TABLE hnfc TO admin;
GRANT ALL ON TABLE hnfc TO xtrole;


--
-- Name: hnfc_hnfc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE hnfc_hnfc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE hnfc_hnfc_id_seq FROM admin;
GRANT ALL ON SEQUENCE hnfc_hnfc_id_seq TO admin;
GRANT ALL ON SEQUENCE hnfc_hnfc_id_seq TO xtrole;


--
-- Name: incdt_incdt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdt_incdt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdt_incdt_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdt_incdt_id_seq TO admin;
GRANT ALL ON SEQUENCE incdt_incdt_id_seq TO xtrole;


--
-- Name: incdtcat_incdtcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdtcat_incdtcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdtcat_incdtcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdtcat_incdtcat_id_seq TO admin;
GRANT ALL ON SEQUENCE incdtcat_incdtcat_id_seq TO xtrole;


--
-- Name: incdthist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE incdthist FROM PUBLIC;
REVOKE ALL ON TABLE incdthist FROM admin;
GRANT ALL ON TABLE incdthist TO admin;
GRANT ALL ON TABLE incdthist TO xtrole;


--
-- Name: incdthist_incdthist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdthist_incdthist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdthist_incdthist_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdthist_incdthist_id_seq TO admin;
GRANT ALL ON SEQUENCE incdthist_incdthist_id_seq TO xtrole;


--
-- Name: incdtpriority_incdtpriority_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdtpriority_incdtpriority_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdtpriority_incdtpriority_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdtpriority_incdtpriority_id_seq TO admin;
GRANT ALL ON SEQUENCE incdtpriority_incdtpriority_id_seq TO xtrole;


--
-- Name: incdtresolution_incdtresolution_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdtresolution_incdtresolution_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdtresolution_incdtresolution_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdtresolution_incdtresolution_id_seq TO admin;
GRANT ALL ON SEQUENCE incdtresolution_incdtresolution_id_seq TO xtrole;


--
-- Name: incdtseverity_incdtseverity_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE incdtseverity_incdtseverity_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE incdtseverity_incdtseverity_id_seq FROM admin;
GRANT ALL ON SEQUENCE incdtseverity_incdtseverity_id_seq TO admin;
GRANT ALL ON SEQUENCE incdtseverity_incdtseverity_id_seq TO xtrole;


--
-- Name: invbal_invbal_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invbal_invbal_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invbal_invbal_id_seq FROM admin;
GRANT ALL ON SEQUENCE invbal_invbal_id_seq TO admin;
GRANT ALL ON SEQUENCE invbal_invbal_id_seq TO xtrole;


--
-- Name: invc_invc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invc_invc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invc_invc_id_seq FROM admin;
GRANT ALL ON SEQUENCE invc_invc_id_seq TO admin;
GRANT ALL ON SEQUENCE invc_invc_id_seq TO xtrole;


--
-- Name: invchead_invchead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invchead_invchead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invchead_invchead_id_seq FROM admin;
GRANT ALL ON SEQUENCE invchead_invchead_id_seq TO admin;
GRANT ALL ON SEQUENCE invchead_invchead_id_seq TO xtrole;


--
-- Name: invcheadtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invcheadtax FROM PUBLIC;
REVOKE ALL ON TABLE invcheadtax FROM admin;
GRANT ALL ON TABLE invcheadtax TO admin;
GRANT ALL ON TABLE invcheadtax TO xtrole;


--
-- Name: invcitem_invcitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invcitem_invcitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invcitem_invcitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE invcitem_invcitem_id_seq TO admin;
GRANT ALL ON SEQUENCE invcitem_invcitem_id_seq TO xtrole;


--
-- Name: invcitemtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invcitemtax FROM PUBLIC;
REVOKE ALL ON TABLE invcitemtax FROM admin;
GRANT ALL ON TABLE invcitemtax TO admin;
GRANT ALL ON TABLE invcitemtax TO xtrole;


--
-- Name: invcnt_invcnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invcnt_invcnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invcnt_invcnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE invcnt_invcnt_id_seq TO admin;
GRANT ALL ON SEQUENCE invcnt_invcnt_id_seq TO xtrole;


--
-- Name: invdetail; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invdetail FROM PUBLIC;
REVOKE ALL ON TABLE invdetail FROM admin;
GRANT ALL ON TABLE invdetail TO admin;
GRANT ALL ON TABLE invdetail TO xtrole;


--
-- Name: invdetail_invdetail_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invdetail_invdetail_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invdetail_invdetail_id_seq FROM admin;
GRANT ALL ON SEQUENCE invdetail_invdetail_id_seq TO admin;
GRANT ALL ON SEQUENCE invdetail_invdetail_id_seq TO xtrole;


--
-- Name: invhist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invhist FROM PUBLIC;
REVOKE ALL ON TABLE invhist FROM admin;
GRANT ALL ON TABLE invhist TO admin;
GRANT ALL ON TABLE invhist TO xtrole;


--
-- Name: invhist_invhist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invhist_invhist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invhist_invhist_id_seq FROM admin;
GRANT ALL ON SEQUENCE invhist_invhist_id_seq TO admin;
GRANT ALL ON SEQUENCE invhist_invhist_id_seq TO xtrole;


--
-- Name: invhistexpcat; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invhistexpcat FROM PUBLIC;
REVOKE ALL ON TABLE invhistexpcat FROM admin;
GRANT ALL ON TABLE invhistexpcat TO admin;
GRANT ALL ON TABLE invhistexpcat TO xtrole;


--
-- Name: invhistexpcat_invhistexpcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE invhistexpcat_invhistexpcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE invhistexpcat_invhistexpcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE invhistexpcat_invhistexpcat_id_seq TO admin;
GRANT ALL ON SEQUENCE invhistexpcat_invhistexpcat_id_seq TO xtrole;


--
-- Name: invoiceitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE invoiceitem FROM PUBLIC;
REVOKE ALL ON TABLE invoiceitem FROM admin;
GRANT ALL ON TABLE invoiceitem TO admin;
GRANT ALL ON TABLE invoiceitem TO xtrole;


--
-- Name: ipsass_ipsass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsass_ipsass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsass_ipsass_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsass_ipsass_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsass_ipsass_id_seq TO xtrole;


--
-- Name: ipsctyp_ipsctyp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsctyp_ipsctyp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsctyp_ipsctyp_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsctyp_ipsctyp_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsctyp_ipsctyp_id_seq TO xtrole;


--
-- Name: ipscust_ipscust_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipscust_ipscust_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipscust_ipscust_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipscust_ipscust_id_seq TO admin;
GRANT ALL ON SEQUENCE ipscust_ipscust_id_seq TO xtrole;


--
-- Name: ipsfreight_ipsfreight_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsfreight_ipsfreight_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsfreight_ipsfreight_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsfreight_ipsfreight_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsfreight_ipsfreight_id_seq TO xtrole;


--
-- Name: ipshead_ipshead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipshead_ipshead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipshead_ipshead_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipshead_ipshead_id_seq TO admin;
GRANT ALL ON SEQUENCE ipshead_ipshead_id_seq TO xtrole;


--
-- Name: ipsitem_ipsitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsitem_ipsitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsitem_ipsitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsitem_ipsitem_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsitem_ipsitem_id_seq TO xtrole;


--
-- Name: ipsitemchar_ipsitemchar_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsitemchar_ipsitemchar_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsitemchar_ipsitemchar_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsitemchar_ipsitemchar_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsitemchar_ipsitemchar_id_seq TO xtrole;


--
-- Name: ipsprice; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsprice FROM PUBLIC;
REVOKE ALL ON TABLE ipsprice FROM admin;
GRANT ALL ON TABLE ipsprice TO admin;
GRANT ALL ON TABLE ipsprice TO xtrole;


--
-- Name: ipsprodcat_bak; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE ipsprodcat_bak FROM PUBLIC;
REVOKE ALL ON TABLE ipsprodcat_bak FROM admin;
GRANT ALL ON TABLE ipsprodcat_bak TO admin;
GRANT ALL ON TABLE ipsprodcat_bak TO xtrole;


--
-- Name: ipsprodcat_ipsprodcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ipsprodcat_ipsprodcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ipsprodcat_ipsprodcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE ipsprodcat_ipsprodcat_id_seq TO admin;
GRANT ALL ON SEQUENCE ipsprodcat_ipsprodcat_id_seq TO xtrole;


--
-- Name: item_item_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE item_item_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE item_item_id_seq FROM admin;
GRANT ALL ON SEQUENCE item_item_id_seq TO admin;
GRANT ALL ON SEQUENCE item_item_id_seq TO xtrole;


--
-- Name: itemalias_itemalias_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemalias_itemalias_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemalias_itemalias_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemalias_itemalias_id_seq TO admin;
GRANT ALL ON SEQUENCE itemalias_itemalias_id_seq TO xtrole;


--
-- Name: itematr_itematr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itematr_itematr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itematr_itematr_id_seq FROM admin;
GRANT ALL ON SEQUENCE itematr_itematr_id_seq TO admin;
GRANT ALL ON SEQUENCE itematr_itematr_id_seq TO xtrole;


--
-- Name: itemcost_itemcost_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemcost_itemcost_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemcost_itemcost_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemcost_itemcost_id_seq TO admin;
GRANT ALL ON SEQUENCE itemcost_itemcost_id_seq TO xtrole;


--
-- Name: itemfrez_itemfrez_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemfrez_itemfrez_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemfrez_itemfrez_seq FROM admin;
GRANT ALL ON SEQUENCE itemfrez_itemfrez_seq TO admin;
GRANT ALL ON SEQUENCE itemfrez_itemfrez_seq TO xtrole;


--
-- Name: itemgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemgrp FROM PUBLIC;
REVOKE ALL ON TABLE itemgrp FROM admin;
GRANT ALL ON TABLE itemgrp TO admin;
GRANT ALL ON TABLE itemgrp TO xtrole;


--
-- Name: itemgrp_itemgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemgrp_itemgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemgrp_itemgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemgrp_itemgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE itemgrp_itemgrp_id_seq TO xtrole;


--
-- Name: itemgrpitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemgrpitem FROM PUBLIC;
REVOKE ALL ON TABLE itemgrpitem FROM admin;
GRANT ALL ON TABLE itemgrpitem TO admin;
GRANT ALL ON TABLE itemgrpitem TO xtrole;


--
-- Name: itemgrpitem_itemgrpitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemgrpitem_itemgrpitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemgrpitem_itemgrpitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemgrpitem_itemgrpitem_id_seq TO admin;
GRANT ALL ON SEQUENCE itemgrpitem_itemgrpitem_id_seq TO xtrole;


--
-- Name: itemimage; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemimage FROM PUBLIC;
REVOKE ALL ON TABLE itemimage FROM admin;
GRANT ALL ON TABLE itemimage TO admin;
GRANT ALL ON TABLE itemimage TO xtrole;


--
-- Name: itemimage_itemimage_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemimage_itemimage_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemimage_itemimage_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemimage_itemimage_id_seq TO admin;
GRANT ALL ON SEQUENCE itemimage_itemimage_id_seq TO xtrole;


--
-- Name: itemloc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemloc FROM PUBLIC;
REVOKE ALL ON TABLE itemloc FROM admin;
GRANT ALL ON TABLE itemloc TO admin;
GRANT ALL ON TABLE itemloc TO xtrole;


--
-- Name: itemloc_itemloc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemloc_itemloc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemloc_itemloc_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemloc_itemloc_id_seq TO admin;
GRANT ALL ON SEQUENCE itemloc_itemloc_id_seq TO xtrole;


--
-- Name: itemloc_series_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemloc_series_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemloc_series_seq FROM admin;
GRANT ALL ON SEQUENCE itemloc_series_seq TO admin;
GRANT ALL ON SEQUENCE itemloc_series_seq TO xtrole;


--
-- Name: itemlocdist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemlocdist FROM PUBLIC;
REVOKE ALL ON TABLE itemlocdist FROM admin;
GRANT ALL ON TABLE itemlocdist TO admin;
GRANT ALL ON TABLE itemlocdist TO xtrole;


--
-- Name: itemlocdist_itemlocdist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemlocdist_itemlocdist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemlocdist_itemlocdist_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemlocdist_itemlocdist_id_seq TO admin;
GRANT ALL ON SEQUENCE itemlocdist_itemlocdist_id_seq TO xtrole;


--
-- Name: itemlocpost; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemlocpost FROM PUBLIC;
REVOKE ALL ON TABLE itemlocpost FROM admin;
GRANT ALL ON TABLE itemlocpost TO admin;
GRANT ALL ON TABLE itemlocpost TO xtrole;


--
-- Name: itemlocpost_itemlocpost_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemlocpost_itemlocpost_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemlocpost_itemlocpost_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemlocpost_itemlocpost_id_seq TO admin;
GRANT ALL ON SEQUENCE itemlocpost_itemlocpost_id_seq TO xtrole;


--
-- Name: itemopn_itemopn_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemopn_itemopn_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemopn_itemopn_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemopn_itemopn_id_seq TO admin;
GRANT ALL ON SEQUENCE itemopn_itemopn_id_seq TO xtrole;


--
-- Name: itemsite_itemsite_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemsite_itemsite_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemsite_itemsite_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemsite_itemsite_id_seq TO admin;
GRANT ALL ON SEQUENCE itemsite_itemsite_id_seq TO xtrole;


--
-- Name: itemsrc_itemsrc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemsrc_itemsrc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemsrc_itemsrc_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemsrc_itemsrc_id_seq TO admin;
GRANT ALL ON SEQUENCE itemsrc_itemsrc_id_seq TO xtrole;


--
-- Name: itemsrcp_itemsrcp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemsrcp_itemsrcp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemsrcp_itemsrcp_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemsrcp_itemsrcp_id_seq TO admin;
GRANT ALL ON SEQUENCE itemsrcp_itemsrcp_id_seq TO xtrole;


--
-- Name: itemsub_itemsub_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemsub_itemsub_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemsub_itemsub_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemsub_itemsub_id_seq TO admin;
GRANT ALL ON SEQUENCE itemsub_itemsub_id_seq TO xtrole;


--
-- Name: itemtax_itemtax_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemtax_itemtax_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemtax_itemtax_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemtax_itemtax_id_seq TO admin;
GRANT ALL ON SEQUENCE itemtax_itemtax_id_seq TO xtrole;


--
-- Name: itemtrans; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemtrans FROM PUBLIC;
REVOKE ALL ON TABLE itemtrans FROM admin;
GRANT ALL ON TABLE itemtrans TO admin;
GRANT ALL ON TABLE itemtrans TO xtrole;


--
-- Name: itemtrans_itemtrans_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemtrans_itemtrans_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemtrans_itemtrans_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemtrans_itemtrans_id_seq TO admin;
GRANT ALL ON SEQUENCE itemtrans_itemtrans_id_seq TO xtrole;


--
-- Name: itemuom; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE itemuom FROM PUBLIC;
REVOKE ALL ON TABLE itemuom FROM admin;
GRANT ALL ON TABLE itemuom TO admin;
GRANT ALL ON TABLE itemuom TO xtrole;


--
-- Name: itemuom_itemuom_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemuom_itemuom_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemuom_itemuom_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemuom_itemuom_id_seq TO admin;
GRANT ALL ON SEQUENCE itemuom_itemuom_id_seq TO xtrole;


--
-- Name: itemuomconv_itemuomconv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE itemuomconv_itemuomconv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE itemuomconv_itemuomconv_id_seq FROM admin;
GRANT ALL ON SEQUENCE itemuomconv_itemuomconv_id_seq TO admin;
GRANT ALL ON SEQUENCE itemuomconv_itemuomconv_id_seq TO xtrole;


--
-- Name: journal_number_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE journal_number_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE journal_number_seq FROM admin;
GRANT ALL ON SEQUENCE journal_number_seq TO admin;
GRANT ALL ON SEQUENCE journal_number_seq TO xtrole;


--
-- Name: jrnluse; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE jrnluse FROM PUBLIC;
REVOKE ALL ON TABLE jrnluse FROM admin;
GRANT ALL ON TABLE jrnluse TO admin;
GRANT ALL ON TABLE jrnluse TO xtrole;


--
-- Name: jrnluse_jrnluse_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE jrnluse_jrnluse_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE jrnluse_jrnluse_id_seq FROM admin;
GRANT ALL ON SEQUENCE jrnluse_jrnluse_id_seq TO admin;
GRANT ALL ON SEQUENCE jrnluse_jrnluse_id_seq TO xtrole;


--
-- Name: labeldef; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE labeldef FROM PUBLIC;
REVOKE ALL ON TABLE labeldef FROM admin;
GRANT ALL ON TABLE labeldef TO admin;
GRANT ALL ON TABLE labeldef TO xtrole;


--
-- Name: labeldef_labeldef_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE labeldef_labeldef_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE labeldef_labeldef_id_seq FROM admin;
GRANT ALL ON SEQUENCE labeldef_labeldef_id_seq TO admin;
GRANT ALL ON SEQUENCE labeldef_labeldef_id_seq TO xtrole;


--
-- Name: labelform; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE labelform FROM PUBLIC;
REVOKE ALL ON TABLE labelform FROM admin;
GRANT ALL ON TABLE labelform TO admin;
GRANT ALL ON TABLE labelform TO xtrole;


--
-- Name: labelform_labelform_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE labelform_labelform_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE labelform_labelform_id_seq FROM admin;
GRANT ALL ON SEQUENCE labelform_labelform_id_seq TO admin;
GRANT ALL ON SEQUENCE labelform_labelform_id_seq TO xtrole;


--
-- Name: lang; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE lang FROM PUBLIC;
REVOKE ALL ON TABLE lang FROM admin;
GRANT ALL ON TABLE lang TO admin;
GRANT ALL ON TABLE lang TO xtrole;


--
-- Name: lang_lang_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE lang_lang_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE lang_lang_id_seq FROM admin;
GRANT ALL ON SEQUENCE lang_lang_id_seq TO admin;
GRANT ALL ON SEQUENCE lang_lang_id_seq TO xtrole;


--
-- Name: locale; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE locale FROM PUBLIC;
REVOKE ALL ON TABLE locale FROM admin;
GRANT ALL ON TABLE locale TO admin;
GRANT ALL ON TABLE locale TO xtrole;


--
-- Name: locale_locale_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE locale_locale_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE locale_locale_id_seq FROM admin;
GRANT ALL ON SEQUENCE locale_locale_id_seq TO admin;
GRANT ALL ON SEQUENCE locale_locale_id_seq TO xtrole;


--
-- Name: location_location_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE location_location_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE location_location_id_seq FROM admin;
GRANT ALL ON SEQUENCE location_location_id_seq TO admin;
GRANT ALL ON SEQUENCE location_location_id_seq TO xtrole;


--
-- Name: locitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE locitem FROM PUBLIC;
REVOKE ALL ON TABLE locitem FROM admin;
GRANT ALL ON TABLE locitem TO admin;
GRANT ALL ON TABLE locitem TO xtrole;


--
-- Name: locitem_locitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE locitem_locitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE locitem_locitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE locitem_locitem_id_seq TO admin;
GRANT ALL ON SEQUENCE locitem_locitem_id_seq TO xtrole;


--
-- Name: log_log_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE log_log_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE log_log_id_seq FROM admin;
GRANT ALL ON SEQUENCE log_log_id_seq TO admin;
GRANT ALL ON SEQUENCE log_log_id_seq TO xtrole;


--
-- Name: metric; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE metric FROM PUBLIC;
REVOKE ALL ON TABLE metric FROM admin;
GRANT ALL ON TABLE metric TO admin;
GRANT ALL ON TABLE metric TO xtrole;


--
-- Name: metric_metric_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE metric_metric_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE metric_metric_id_seq FROM admin;
GRANT ALL ON SEQUENCE metric_metric_id_seq TO admin;
GRANT ALL ON SEQUENCE metric_metric_id_seq TO xtrole;


--
-- Name: metricenc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE metricenc FROM PUBLIC;
REVOKE ALL ON TABLE metricenc FROM admin;
GRANT ALL ON TABLE metricenc TO admin;
GRANT ALL ON TABLE metricenc TO xtrole;


--
-- Name: metricenc_metricenc_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE metricenc_metricenc_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE metricenc_metricenc_id_seq FROM admin;
GRANT ALL ON SEQUENCE metricenc_metricenc_id_seq TO admin;
GRANT ALL ON SEQUENCE metricenc_metricenc_id_seq TO xtrole;


--
-- Name: misc_index_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE misc_index_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE misc_index_seq FROM admin;
GRANT ALL ON SEQUENCE misc_index_seq TO admin;
GRANT ALL ON SEQUENCE misc_index_seq TO xtrole;


--
-- Name: mrghist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE mrghist FROM PUBLIC;
REVOKE ALL ON TABLE mrghist FROM admin;
GRANT ALL ON TABLE mrghist TO admin;
GRANT ALL ON TABLE mrghist TO xtrole;


--
-- Name: mrgundo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE mrgundo FROM PUBLIC;
REVOKE ALL ON TABLE mrgundo FROM admin;
GRANT ALL ON TABLE mrgundo TO admin;
GRANT ALL ON TABLE mrgundo TO xtrole;


--
-- Name: msg; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE msg FROM PUBLIC;
REVOKE ALL ON TABLE msg FROM admin;
GRANT ALL ON TABLE msg TO admin;
GRANT ALL ON TABLE msg TO xtrole;


--
-- Name: msg_msg_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE msg_msg_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE msg_msg_id_seq FROM admin;
GRANT ALL ON SEQUENCE msg_msg_id_seq TO admin;
GRANT ALL ON SEQUENCE msg_msg_id_seq TO xtrole;


--
-- Name: msguser; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE msguser FROM PUBLIC;
REVOKE ALL ON TABLE msguser FROM admin;
GRANT ALL ON TABLE msguser TO admin;
GRANT ALL ON TABLE msguser TO xtrole;


--
-- Name: msguser_msguser_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE msguser_msguser_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE msguser_msguser_id_seq FROM admin;
GRANT ALL ON SEQUENCE msguser_msguser_id_seq TO admin;
GRANT ALL ON SEQUENCE msguser_msguser_id_seq TO xtrole;


--
-- Name: nvend_nvend_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE nvend_nvend_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE nvend_nvend_id_seq FROM admin;
GRANT ALL ON SEQUENCE nvend_nvend_id_seq TO admin;
GRANT ALL ON SEQUENCE nvend_nvend_id_seq TO xtrole;


--
-- Name: obsolete_tax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE obsolete_tax FROM PUBLIC;
REVOKE ALL ON TABLE obsolete_tax FROM admin;
GRANT ALL ON TABLE obsolete_tax TO admin;
GRANT ALL ON TABLE obsolete_tax TO xtrole;


--
-- Name: ophead_ophead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE ophead_ophead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE ophead_ophead_id_seq FROM admin;
GRANT ALL ON SEQUENCE ophead_ophead_id_seq TO admin;
GRANT ALL ON SEQUENCE ophead_ophead_id_seq TO xtrole;


--
-- Name: opsource; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE opsource FROM PUBLIC;
REVOKE ALL ON TABLE opsource FROM admin;
GRANT ALL ON TABLE opsource TO admin;
GRANT ALL ON TABLE opsource TO xtrole;


--
-- Name: opsource_opsource_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE opsource_opsource_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE opsource_opsource_id_seq FROM admin;
GRANT ALL ON SEQUENCE opsource_opsource_id_seq TO admin;
GRANT ALL ON SEQUENCE opsource_opsource_id_seq TO xtrole;


--
-- Name: opstage; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE opstage FROM PUBLIC;
REVOKE ALL ON TABLE opstage FROM admin;
GRANT ALL ON TABLE opstage TO admin;
GRANT ALL ON TABLE opstage TO xtrole;


--
-- Name: opstage_opstage_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE opstage_opstage_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE opstage_opstage_id_seq FROM admin;
GRANT ALL ON SEQUENCE opstage_opstage_id_seq TO admin;
GRANT ALL ON SEQUENCE opstage_opstage_id_seq TO xtrole;


--
-- Name: optype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE optype FROM PUBLIC;
REVOKE ALL ON TABLE optype FROM admin;
GRANT ALL ON TABLE optype TO admin;
GRANT ALL ON TABLE optype TO xtrole;


--
-- Name: optype_optype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE optype_optype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE optype_optype_id_seq FROM admin;
GRANT ALL ON SEQUENCE optype_optype_id_seq TO admin;
GRANT ALL ON SEQUENCE optype_optype_id_seq TO xtrole;


--
-- Name: orderhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE orderhead FROM PUBLIC;
REVOKE ALL ON TABLE orderhead FROM admin;
GRANT ALL ON TABLE orderhead TO admin;
GRANT ALL ON TABLE orderhead TO xtrole;


--
-- Name: orderitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE orderitem FROM PUBLIC;
REVOKE ALL ON TABLE orderitem FROM admin;
GRANT ALL ON TABLE orderitem TO admin;
GRANT ALL ON TABLE orderitem TO xtrole;


--
-- Name: orderseq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE orderseq FROM PUBLIC;
REVOKE ALL ON TABLE orderseq FROM admin;
GRANT ALL ON TABLE orderseq TO admin;
GRANT ALL ON TABLE orderseq TO xtrole;


--
-- Name: orderseq_orderseq_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE orderseq_orderseq_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE orderseq_orderseq_id_seq FROM admin;
GRANT ALL ON SEQUENCE orderseq_orderseq_id_seq TO admin;
GRANT ALL ON SEQUENCE orderseq_orderseq_id_seq TO xtrole;


--
-- Name: pack; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pack FROM PUBLIC;
REVOKE ALL ON TABLE pack FROM admin;
GRANT ALL ON TABLE pack TO admin;
GRANT ALL ON TABLE pack TO xtrole;


--
-- Name: pack_pack_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pack_pack_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pack_pack_id_seq FROM admin;
GRANT ALL ON SEQUENCE pack_pack_id_seq TO admin;
GRANT ALL ON SEQUENCE pack_pack_id_seq TO xtrole;


--
-- Name: payaropen; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE payaropen FROM PUBLIC;
REVOKE ALL ON TABLE payaropen FROM admin;
GRANT ALL ON TABLE payaropen TO admin;
GRANT ALL ON TABLE payaropen TO xtrole;


--
-- Name: payco; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE payco FROM PUBLIC;
REVOKE ALL ON TABLE payco FROM admin;
GRANT ALL ON TABLE payco TO admin;
GRANT ALL ON TABLE payco TO xtrole;


--
-- Name: payco_payco_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE payco_payco_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE payco_payco_id_seq FROM admin;
GRANT ALL ON SEQUENCE payco_payco_id_seq TO admin;
GRANT ALL ON SEQUENCE payco_payco_id_seq TO xtrole;


--
-- Name: period_period_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE period_period_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE period_period_id_seq FROM admin;
GRANT ALL ON SEQUENCE period_period_id_seq TO admin;
GRANT ALL ON SEQUENCE period_period_id_seq TO xtrole;


--
-- Name: pkgdep; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pkgdep FROM PUBLIC;
REVOKE ALL ON TABLE pkgdep FROM admin;
GRANT ALL ON TABLE pkgdep TO admin;
GRANT ALL ON TABLE pkgdep TO xtrole;


--
-- Name: pkgdep_pkgdep_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pkgdep_pkgdep_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pkgdep_pkgdep_id_seq FROM admin;
GRANT ALL ON SEQUENCE pkgdep_pkgdep_id_seq TO admin;
GRANT ALL ON SEQUENCE pkgdep_pkgdep_id_seq TO xtrole;


--
-- Name: pkghead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pkghead FROM PUBLIC;
REVOKE ALL ON TABLE pkghead FROM admin;
GRANT ALL ON TABLE pkghead TO admin;
GRANT ALL ON TABLE pkghead TO xtrole;


--
-- Name: pkghead_pkghead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pkghead_pkghead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pkghead_pkghead_id_seq FROM admin;
GRANT ALL ON SEQUENCE pkghead_pkghead_id_seq TO admin;
GRANT ALL ON SEQUENCE pkghead_pkghead_id_seq TO xtrole;


--
-- Name: pkgitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pkgitem FROM PUBLIC;
REVOKE ALL ON TABLE pkgitem FROM admin;
GRANT ALL ON TABLE pkgitem TO admin;
GRANT ALL ON TABLE pkgitem TO xtrole;


--
-- Name: pkgitem_pkgitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pkgitem_pkgitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pkgitem_pkgitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE pkgitem_pkgitem_id_seq TO admin;
GRANT ALL ON SEQUENCE pkgitem_pkgitem_id_seq TO xtrole;


--
-- Name: plancode_plancode_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE plancode_plancode_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE plancode_plancode_id_seq FROM admin;
GRANT ALL ON SEQUENCE plancode_plancode_id_seq TO admin;
GRANT ALL ON SEQUENCE plancode_plancode_id_seq TO xtrole;


--
-- Name: planord_planord_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE planord_planord_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE planord_planord_id_seq FROM admin;
GRANT ALL ON SEQUENCE planord_planord_id_seq TO admin;
GRANT ALL ON SEQUENCE planord_planord_id_seq TO xtrole;


--
-- Name: pohead_pohead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pohead_pohead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pohead_pohead_id_seq FROM admin;
GRANT ALL ON SEQUENCE pohead_pohead_id_seq TO admin;
GRANT ALL ON SEQUENCE pohead_pohead_id_seq TO xtrole;


--
-- Name: poitem_poitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE poitem_poitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE poitem_poitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE poitem_poitem_id_seq TO admin;
GRANT ALL ON SEQUENCE poitem_poitem_id_seq TO xtrole;


--
-- Name: recv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE recv FROM PUBLIC;
REVOKE ALL ON TABLE recv FROM admin;
GRANT ALL ON TABLE recv TO admin;
GRANT ALL ON TABLE recv TO xtrole;


--
-- Name: porecv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE porecv FROM PUBLIC;
REVOKE ALL ON TABLE porecv FROM admin;
GRANT ALL ON TABLE porecv TO admin;
GRANT ALL ON TABLE porecv TO xtrole;


--
-- Name: porecv_porecv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE porecv_porecv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE porecv_porecv_id_seq FROM admin;
GRANT ALL ON SEQUENCE porecv_porecv_id_seq TO admin;
GRANT ALL ON SEQUENCE porecv_porecv_id_seq TO xtrole;


--
-- Name: poreject; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE poreject FROM PUBLIC;
REVOKE ALL ON TABLE poreject FROM admin;
GRANT ALL ON TABLE poreject TO admin;
GRANT ALL ON TABLE poreject TO xtrole;


--
-- Name: poreject_poreject_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE poreject_poreject_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE poreject_poreject_id_seq FROM admin;
GRANT ALL ON SEQUENCE poreject_poreject_id_seq TO admin;
GRANT ALL ON SEQUENCE poreject_poreject_id_seq TO xtrole;


--
-- Name: pr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE pr FROM PUBLIC;
REVOKE ALL ON TABLE pr FROM admin;
GRANT ALL ON TABLE pr TO admin;
GRANT ALL ON TABLE pr TO xtrole;


--
-- Name: pr_pr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE pr_pr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE pr_pr_id_seq FROM admin;
GRANT ALL ON SEQUENCE pr_pr_id_seq TO admin;
GRANT ALL ON SEQUENCE pr_pr_id_seq TO xtrole;


--
-- Name: prftcntr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prftcntr FROM PUBLIC;
REVOKE ALL ON TABLE prftcntr FROM admin;
GRANT ALL ON TABLE prftcntr TO admin;
GRANT ALL ON TABLE prftcntr TO xtrole;


--
-- Name: prftcntr_prftcntr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prftcntr_prftcntr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prftcntr_prftcntr_id_seq FROM admin;
GRANT ALL ON SEQUENCE prftcntr_prftcntr_id_seq TO admin;
GRANT ALL ON SEQUENCE prftcntr_prftcntr_id_seq TO xtrole;


--
-- Name: usrgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE usrgrp FROM PUBLIC;
REVOKE ALL ON TABLE usrgrp FROM admin;
GRANT ALL ON TABLE usrgrp TO admin;
GRANT ALL ON TABLE usrgrp TO xtrole;


--
-- Name: usrpriv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE usrpriv FROM PUBLIC;
REVOKE ALL ON TABLE usrpriv FROM admin;
GRANT ALL ON TABLE usrpriv TO admin;
GRANT ALL ON TABLE usrpriv TO xtrole;


--
-- Name: privgranted; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE privgranted FROM PUBLIC;
REVOKE ALL ON TABLE privgranted FROM admin;
GRANT ALL ON TABLE privgranted TO admin;
GRANT ALL ON TABLE privgranted TO xtrole;


--
-- Name: prj_prj_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prj_prj_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prj_prj_id_seq FROM admin;
GRANT ALL ON SEQUENCE prj_prj_id_seq TO admin;
GRANT ALL ON SEQUENCE prj_prj_id_seq TO xtrole;


--
-- Name: prjtask_prjtask_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prjtask_prjtask_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prjtask_prjtask_id_seq FROM admin;
GRANT ALL ON SEQUENCE prjtask_prjtask_id_seq TO admin;
GRANT ALL ON SEQUENCE prjtask_prjtask_id_seq TO xtrole;


--
-- Name: prjtaskuser; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prjtaskuser FROM PUBLIC;
REVOKE ALL ON TABLE prjtaskuser FROM admin;
GRANT ALL ON TABLE prjtaskuser TO admin;
GRANT ALL ON TABLE prjtaskuser TO xtrole;


--
-- Name: prjtaskuser_prjtaskuser_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prjtaskuser_prjtaskuser_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prjtaskuser_prjtaskuser_id_seq FROM admin;
GRANT ALL ON SEQUENCE prjtaskuser_prjtaskuser_id_seq TO admin;
GRANT ALL ON SEQUENCE prjtaskuser_prjtaskuser_id_seq TO xtrole;


--
-- Name: prjtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE prjtype FROM PUBLIC;
REVOKE ALL ON TABLE prjtype FROM admin;
GRANT ALL ON TABLE prjtype TO admin;
GRANT ALL ON TABLE prjtype TO xtrole;


--
-- Name: prjtype_prjtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prjtype_prjtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prjtype_prjtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE prjtype_prjtype_id_seq TO admin;
GRANT ALL ON SEQUENCE prjtype_prjtype_id_seq TO xtrole;


--
-- Name: prodcat_prodcat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE prodcat_prodcat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE prodcat_prodcat_id_seq FROM admin;
GRANT ALL ON SEQUENCE prodcat_prodcat_id_seq TO admin;
GRANT ALL ON SEQUENCE prodcat_prodcat_id_seq TO xtrole;


--
-- Name: qryhead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE qryhead FROM PUBLIC;
REVOKE ALL ON TABLE qryhead FROM admin;
GRANT ALL ON TABLE qryhead TO admin;
GRANT ALL ON TABLE qryhead TO xtrole;


--
-- Name: qryhead_qryhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE qryhead_qryhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE qryhead_qryhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE qryhead_qryhead_id_seq TO admin;
GRANT ALL ON SEQUENCE qryhead_qryhead_id_seq TO xtrole;


--
-- Name: qryitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE qryitem FROM PUBLIC;
REVOKE ALL ON TABLE qryitem FROM admin;
GRANT ALL ON TABLE qryitem TO admin;
GRANT ALL ON TABLE qryitem TO xtrole;


--
-- Name: qryitem_qryitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE qryitem_qryitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE qryitem_qryitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE qryitem_qryitem_id_seq TO admin;
GRANT ALL ON SEQUENCE qryitem_qryitem_id_seq TO xtrole;


--
-- Name: quhead_quhead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE quhead_quhead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE quhead_quhead_id_seq FROM admin;
GRANT ALL ON SEQUENCE quhead_quhead_id_seq TO admin;
GRANT ALL ON SEQUENCE quhead_quhead_id_seq TO xtrole;


--
-- Name: quitem_quitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE quitem_quitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE quitem_quitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE quitem_quitem_id_seq TO admin;
GRANT ALL ON SEQUENCE quitem_quitem_id_seq TO xtrole;


--
-- Name: rcalitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE rcalitem FROM PUBLIC;
REVOKE ALL ON TABLE rcalitem FROM admin;
GRANT ALL ON TABLE rcalitem TO admin;
GRANT ALL ON TABLE rcalitem TO xtrole;


--
-- Name: recur; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE recur FROM PUBLIC;
REVOKE ALL ON TABLE recur FROM admin;
GRANT ALL ON TABLE recur TO admin;
GRANT ALL ON TABLE recur TO xtrole;


--
-- Name: recur_recur_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE recur_recur_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE recur_recur_id_seq FROM admin;
GRANT ALL ON SEQUENCE recur_recur_id_seq TO admin;
GRANT ALL ON SEQUENCE recur_recur_id_seq TO xtrole;


--
-- Name: recurtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE recurtype FROM PUBLIC;
REVOKE ALL ON TABLE recurtype FROM admin;
GRANT ALL ON TABLE recurtype TO admin;
GRANT ALL ON TABLE recurtype TO xtrole;


--
-- Name: recurtype_recurtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE recurtype_recurtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE recurtype_recurtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE recurtype_recurtype_id_seq TO admin;
GRANT ALL ON SEQUENCE recurtype_recurtype_id_seq TO xtrole;


--
-- Name: recv_recv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE recv_recv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE recv_recv_id_seq FROM admin;
GRANT ALL ON SEQUENCE recv_recv_id_seq TO admin;
GRANT ALL ON SEQUENCE recv_recv_id_seq TO xtrole;


--
-- Name: remitto; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE remitto FROM PUBLIC;
REVOKE ALL ON TABLE remitto FROM admin;
GRANT ALL ON TABLE remitto TO admin;
GRANT ALL ON TABLE remitto TO xtrole;


--
-- Name: rjctcode; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE rjctcode FROM PUBLIC;
REVOKE ALL ON TABLE rjctcode FROM admin;
GRANT ALL ON TABLE rjctcode TO admin;
GRANT ALL ON TABLE rjctcode TO xtrole;


--
-- Name: rjctcode_rjctcode_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE rjctcode_rjctcode_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE rjctcode_rjctcode_id_seq FROM admin;
GRANT ALL ON SEQUENCE rjctcode_rjctcode_id_seq TO admin;
GRANT ALL ON SEQUENCE rjctcode_rjctcode_id_seq TO xtrole;


--
-- Name: rsncode_rsncode_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE rsncode_rsncode_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE rsncode_rsncode_id_seq FROM admin;
GRANT ALL ON SEQUENCE rsncode_rsncode_id_seq TO admin;
GRANT ALL ON SEQUENCE rsncode_rsncode_id_seq TO xtrole;


--
-- Name: sale; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sale FROM PUBLIC;
REVOKE ALL ON TABLE sale FROM admin;
GRANT ALL ON TABLE sale TO admin;
GRANT ALL ON TABLE sale TO xtrole;


--
-- Name: sale_sale_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE sale_sale_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE sale_sale_id_seq FROM admin;
GRANT ALL ON SEQUENCE sale_sale_id_seq TO admin;
GRANT ALL ON SEQUENCE sale_sale_id_seq TO xtrole;


--
-- Name: salesaccnt_salesaccnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE salesaccnt_salesaccnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE salesaccnt_salesaccnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE salesaccnt_salesaccnt_id_seq TO admin;
GRANT ALL ON SEQUENCE salesaccnt_salesaccnt_id_seq TO xtrole;


--
-- Name: salescat_salescat_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE salescat_salescat_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE salescat_salescat_id_seq FROM admin;
GRANT ALL ON SEQUENCE salescat_salescat_id_seq TO admin;
GRANT ALL ON SEQUENCE salescat_salescat_id_seq TO xtrole;


--
-- Name: saleshistory; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE saleshistory FROM PUBLIC;
REVOKE ALL ON TABLE saleshistory FROM admin;
GRANT ALL ON TABLE saleshistory TO admin;
GRANT ALL ON TABLE saleshistory TO xtrole;


--
-- Name: saleshistorymisc; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE saleshistorymisc FROM PUBLIC;
REVOKE ALL ON TABLE saleshistorymisc FROM admin;
GRANT ALL ON TABLE saleshistorymisc TO admin;
GRANT ALL ON TABLE saleshistorymisc TO xtrole;


--
-- Name: salesrep_salesrep_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE salesrep_salesrep_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE salesrep_salesrep_id_seq FROM admin;
GRANT ALL ON SEQUENCE salesrep_salesrep_id_seq TO admin;
GRANT ALL ON SEQUENCE salesrep_salesrep_id_seq TO xtrole;


--
-- Name: saletype_saletype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE saletype_saletype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE saletype_saletype_id_seq FROM admin;
GRANT ALL ON SEQUENCE saletype_saletype_id_seq TO admin;
GRANT ALL ON SEQUENCE saletype_saletype_id_seq TO xtrole;


--
-- Name: schemaord; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE schemaord FROM PUBLIC;
REVOKE ALL ON TABLE schemaord FROM admin;
GRANT ALL ON TABLE schemaord TO admin;
GRANT ALL ON TABLE schemaord TO xtrole;


--
-- Name: schemaord_schemaord_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE schemaord_schemaord_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE schemaord_schemaord_id_seq FROM admin;
GRANT ALL ON SEQUENCE schemaord_schemaord_id_seq TO admin;
GRANT ALL ON SEQUENCE schemaord_schemaord_id_seq TO xtrole;


--
-- Name: sequence; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sequence FROM PUBLIC;
REVOKE ALL ON TABLE sequence FROM admin;
GRANT ALL ON TABLE sequence TO admin;
GRANT ALL ON TABLE sequence TO xtrole;


--
-- Name: shift_shift_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shift_shift_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shift_shift_id_seq FROM admin;
GRANT ALL ON SEQUENCE shift_shift_id_seq TO admin;
GRANT ALL ON SEQUENCE shift_shift_id_seq TO xtrole;


--
-- Name: shipchrg_shipchrg_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipchrg_shipchrg_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipchrg_shipchrg_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipchrg_shipchrg_id_seq TO admin;
GRANT ALL ON SEQUENCE shipchrg_shipchrg_id_seq TO xtrole;


--
-- Name: shipdatasum; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipdatasum FROM PUBLIC;
REVOKE ALL ON TABLE shipdatasum FROM admin;
GRANT ALL ON TABLE shipdatasum TO admin;
GRANT ALL ON TABLE shipdatasum TO xtrole;


--
-- Name: shipform_shipform_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipform_shipform_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipform_shipform_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipform_shipform_id_seq TO admin;
GRANT ALL ON SEQUENCE shipform_shipform_id_seq TO xtrole;


--
-- Name: shiphead_shiphead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shiphead_shiphead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shiphead_shiphead_id_seq FROM admin;
GRANT ALL ON SEQUENCE shiphead_shiphead_id_seq TO admin;
GRANT ALL ON SEQUENCE shiphead_shiphead_id_seq TO xtrole;


--
-- Name: shipitem_shipitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipitem_shipitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipitem_shipitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipitem_shipitem_id_seq TO admin;
GRANT ALL ON SEQUENCE shipitem_shipitem_id_seq TO xtrole;


--
-- Name: shipment_number_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipment_number_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipment_number_seq FROM admin;
GRANT ALL ON SEQUENCE shipment_number_seq TO admin;
GRANT ALL ON SEQUENCE shipment_number_seq TO xtrole;


--
-- Name: shipto; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE shipto FROM PUBLIC;
REVOKE ALL ON TABLE shipto FROM admin;
GRANT ALL ON TABLE shipto TO admin;
GRANT ALL ON TABLE shipto TO xtrole;


--
-- Name: shipto_shipto_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipto_shipto_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipto_shipto_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipto_shipto_id_seq TO admin;
GRANT ALL ON SEQUENCE shipto_shipto_id_seq TO xtrole;


--
-- Name: shipvia_shipvia_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipvia_shipvia_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipvia_shipvia_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipvia_shipvia_id_seq TO admin;
GRANT ALL ON SEQUENCE shipvia_shipvia_id_seq TO xtrole;


--
-- Name: shipzone_shipzone_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE shipzone_shipzone_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE shipzone_shipzone_id_seq FROM admin;
GRANT ALL ON SEQUENCE shipzone_shipzone_id_seq TO admin;
GRANT ALL ON SEQUENCE shipzone_shipzone_id_seq TO xtrole;


--
-- Name: sitetype_sitetype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE sitetype_sitetype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE sitetype_sitetype_id_seq FROM admin;
GRANT ALL ON SEQUENCE sitetype_sitetype_id_seq TO admin;
GRANT ALL ON SEQUENCE sitetype_sitetype_id_seq TO xtrole;


--
-- Name: sltrans; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sltrans FROM PUBLIC;
REVOKE ALL ON TABLE sltrans FROM admin;
GRANT ALL ON TABLE sltrans TO admin;
GRANT ALL ON TABLE sltrans TO xtrole;


--
-- Name: sltrans_backup; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sltrans_backup FROM PUBLIC;
REVOKE ALL ON TABLE sltrans_backup FROM admin;
GRANT ALL ON TABLE sltrans_backup TO admin;
GRANT ALL ON TABLE sltrans_backup TO xtrole;


--
-- Name: sopack; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE sopack FROM PUBLIC;
REVOKE ALL ON TABLE sopack FROM admin;
GRANT ALL ON TABLE sopack TO admin;
GRANT ALL ON TABLE sopack TO xtrole;


--
-- Name: sopack_sopack_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE sopack_sopack_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE sopack_sopack_id_seq FROM admin;
GRANT ALL ON SEQUENCE sopack_sopack_id_seq TO admin;
GRANT ALL ON SEQUENCE sopack_sopack_id_seq TO xtrole;


--
-- Name: source; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE source FROM PUBLIC;
REVOKE ALL ON TABLE source FROM admin;
GRANT ALL ON TABLE source TO admin;
GRANT ALL ON TABLE source TO xtrole;


--
-- Name: source_source_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE source_source_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE source_source_id_seq FROM admin;
GRANT ALL ON SEQUENCE source_source_id_seq TO admin;
GRANT ALL ON SEQUENCE source_source_id_seq TO xtrole;


--
-- Name: state; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE state FROM PUBLIC;
REVOKE ALL ON TABLE state FROM admin;
GRANT ALL ON TABLE state TO admin;
GRANT ALL ON TABLE state TO xtrole;


--
-- Name: state_state_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE state_state_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE state_state_id_seq FROM admin;
GRANT ALL ON SEQUENCE state_state_id_seq TO admin;
GRANT ALL ON SEQUENCE state_state_id_seq TO xtrole;


--
-- Name: status; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE status FROM PUBLIC;
REVOKE ALL ON TABLE status FROM admin;
GRANT ALL ON TABLE status TO admin;
GRANT ALL ON TABLE status TO xtrole;


--
-- Name: status_status_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE status_status_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE status_status_id_seq FROM admin;
GRANT ALL ON SEQUENCE status_status_id_seq TO admin;
GRANT ALL ON SEQUENCE status_status_id_seq TO xtrole;


--
-- Name: stdjrnl; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE stdjrnl FROM PUBLIC;
REVOKE ALL ON TABLE stdjrnl FROM admin;
GRANT ALL ON TABLE stdjrnl TO admin;
GRANT ALL ON TABLE stdjrnl TO xtrole;


--
-- Name: stdjrnl_stdjrnl_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE stdjrnl_stdjrnl_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE stdjrnl_stdjrnl_id_seq FROM admin;
GRANT ALL ON SEQUENCE stdjrnl_stdjrnl_id_seq TO admin;
GRANT ALL ON SEQUENCE stdjrnl_stdjrnl_id_seq TO xtrole;


--
-- Name: stdjrnlgrp; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE stdjrnlgrp FROM PUBLIC;
REVOKE ALL ON TABLE stdjrnlgrp FROM admin;
GRANT ALL ON TABLE stdjrnlgrp TO admin;
GRANT ALL ON TABLE stdjrnlgrp TO xtrole;


--
-- Name: stdjrnlgrp_stdjrnlgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq TO xtrole;


--
-- Name: stdjrnlgrpitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE stdjrnlgrpitem FROM PUBLIC;
REVOKE ALL ON TABLE stdjrnlgrpitem FROM admin;
GRANT ALL ON TABLE stdjrnlgrpitem TO admin;
GRANT ALL ON TABLE stdjrnlgrpitem TO xtrole;


--
-- Name: stdjrnlgrpitem_stdjrnlgrpitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq TO admin;
GRANT ALL ON SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq TO xtrole;


--
-- Name: stdjrnlitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE stdjrnlitem FROM PUBLIC;
REVOKE ALL ON TABLE stdjrnlitem FROM admin;
GRANT ALL ON TABLE stdjrnlitem TO admin;
GRANT ALL ON TABLE stdjrnlitem TO xtrole;


--
-- Name: stdjrnlitem_stdjrnlitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE stdjrnlitem_stdjrnlitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE stdjrnlitem_stdjrnlitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE stdjrnlitem_stdjrnlitem_id_seq TO admin;
GRANT ALL ON SEQUENCE stdjrnlitem_stdjrnlitem_id_seq TO xtrole;


--
-- Name: subaccnt; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE subaccnt FROM PUBLIC;
REVOKE ALL ON TABLE subaccnt FROM admin;
GRANT ALL ON TABLE subaccnt TO admin;
GRANT ALL ON TABLE subaccnt TO xtrole;


--
-- Name: subaccnt_subaccnt_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE subaccnt_subaccnt_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE subaccnt_subaccnt_id_seq FROM admin;
GRANT ALL ON SEQUENCE subaccnt_subaccnt_id_seq TO admin;
GRANT ALL ON SEQUENCE subaccnt_subaccnt_id_seq TO xtrole;


--
-- Name: subaccnttype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE subaccnttype FROM PUBLIC;
REVOKE ALL ON TABLE subaccnttype FROM admin;
GRANT ALL ON TABLE subaccnttype TO admin;
GRANT ALL ON TABLE subaccnttype TO xtrole;


--
-- Name: subaccnttype_subaccnttype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE subaccnttype_subaccnttype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE subaccnttype_subaccnttype_id_seq FROM admin;
GRANT ALL ON SEQUENCE subaccnttype_subaccnttype_id_seq TO admin;
GRANT ALL ON SEQUENCE subaccnttype_subaccnttype_id_seq TO xtrole;


--
-- Name: tax_tax_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE tax_tax_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE tax_tax_id_seq FROM admin;
GRANT ALL ON SEQUENCE tax_tax_id_seq TO admin;
GRANT ALL ON SEQUENCE tax_tax_id_seq TO xtrole;


--
-- Name: taxass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxass FROM PUBLIC;
REVOKE ALL ON TABLE taxass FROM admin;
GRANT ALL ON TABLE taxass TO admin;
GRANT ALL ON TABLE taxass TO xtrole;


--
-- Name: taxass_taxass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxass_taxass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxass_taxass_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxass_taxass_id_seq TO admin;
GRANT ALL ON SEQUENCE taxass_taxass_id_seq TO xtrole;


--
-- Name: taxauth_taxauth_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxauth_taxauth_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxauth_taxauth_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxauth_taxauth_id_seq TO admin;
GRANT ALL ON SEQUENCE taxauth_taxauth_id_seq TO xtrole;


--
-- Name: taxclass; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxclass FROM PUBLIC;
REVOKE ALL ON TABLE taxclass FROM admin;
GRANT ALL ON TABLE taxclass TO admin;
GRANT ALL ON TABLE taxclass TO xtrole;


--
-- Name: taxclass_taxclass_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxclass_taxclass_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxclass_taxclass_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxclass_taxclass_id_seq TO admin;
GRANT ALL ON SEQUENCE taxclass_taxclass_id_seq TO xtrole;


--
-- Name: taxhist_taxhist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxhist_taxhist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxhist_taxhist_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxhist_taxhist_id_seq TO admin;
GRANT ALL ON SEQUENCE taxhist_taxhist_id_seq TO xtrole;


--
-- Name: taxpay; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxpay FROM PUBLIC;
REVOKE ALL ON TABLE taxpay FROM admin;
GRANT ALL ON TABLE taxpay TO admin;
GRANT ALL ON TABLE taxpay TO xtrole;


--
-- Name: taxpay_taxpay_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxpay_taxpay_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxpay_taxpay_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxpay_taxpay_id_seq TO admin;
GRANT ALL ON SEQUENCE taxpay_taxpay_id_seq TO xtrole;


--
-- Name: taxrate; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE taxrate FROM PUBLIC;
REVOKE ALL ON TABLE taxrate FROM admin;
GRANT ALL ON TABLE taxrate TO admin;
GRANT ALL ON TABLE taxrate TO xtrole;


--
-- Name: taxrate_taxrate_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxrate_taxrate_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxrate_taxrate_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxrate_taxrate_id_seq TO admin;
GRANT ALL ON SEQUENCE taxrate_taxrate_id_seq TO xtrole;


--
-- Name: taxreg_taxreg_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxreg_taxreg_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxreg_taxreg_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxreg_taxreg_id_seq TO admin;
GRANT ALL ON SEQUENCE taxreg_taxreg_id_seq TO xtrole;


--
-- Name: taxtype_taxtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxtype_taxtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxtype_taxtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxtype_taxtype_id_seq TO admin;
GRANT ALL ON SEQUENCE taxtype_taxtype_id_seq TO xtrole;


--
-- Name: taxzone_taxzone_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE taxzone_taxzone_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE taxzone_taxzone_id_seq FROM admin;
GRANT ALL ON SEQUENCE taxzone_taxzone_id_seq TO admin;
GRANT ALL ON SEQUENCE taxzone_taxzone_id_seq TO xtrole;


--
-- Name: terms_terms_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE terms_terms_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE terms_terms_id_seq FROM admin;
GRANT ALL ON SEQUENCE terms_terms_id_seq TO admin;
GRANT ALL ON SEQUENCE terms_terms_id_seq TO xtrole;


--
-- Name: todoitem_todoitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE todoitem_todoitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE todoitem_todoitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE todoitem_todoitem_id_seq TO admin;
GRANT ALL ON SEQUENCE todoitem_todoitem_id_seq TO xtrole;


--
-- Name: trgthist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE trgthist FROM PUBLIC;
REVOKE ALL ON TABLE trgthist FROM admin;
GRANT ALL ON TABLE trgthist TO admin;
GRANT ALL ON TABLE trgthist TO xtrole;


--
-- Name: trialbal; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE trialbal FROM PUBLIC;
REVOKE ALL ON TABLE trialbal FROM admin;
GRANT ALL ON TABLE trialbal TO admin;
GRANT ALL ON TABLE trialbal TO xtrole;


--
-- Name: trialbal_trialbal_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE trialbal_trialbal_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE trialbal_trialbal_id_seq FROM admin;
GRANT ALL ON SEQUENCE trialbal_trialbal_id_seq TO admin;
GRANT ALL ON SEQUENCE trialbal_trialbal_id_seq TO xtrole;


--
-- Name: uom_uom_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE uom_uom_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE uom_uom_id_seq FROM admin;
GRANT ALL ON SEQUENCE uom_uom_id_seq TO admin;
GRANT ALL ON SEQUENCE uom_uom_id_seq TO xtrole;


--
-- Name: uomconv; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE uomconv FROM PUBLIC;
REVOKE ALL ON TABLE uomconv FROM admin;
GRANT ALL ON TABLE uomconv TO admin;
GRANT ALL ON TABLE uomconv TO xtrole;


--
-- Name: uomconv_uomconv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE uomconv_uomconv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE uomconv_uomconv_id_seq FROM admin;
GRANT ALL ON SEQUENCE uomconv_uomconv_id_seq TO admin;
GRANT ALL ON SEQUENCE uomconv_uomconv_id_seq TO xtrole;


--
-- Name: uomtype; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE uomtype FROM PUBLIC;
REVOKE ALL ON TABLE uomtype FROM admin;
GRANT ALL ON TABLE uomtype TO admin;
GRANT ALL ON TABLE uomtype TO xtrole;


--
-- Name: uomtype_uomtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE uomtype_uomtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE uomtype_uomtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE uomtype_uomtype_id_seq TO admin;
GRANT ALL ON SEQUENCE uomtype_uomtype_id_seq TO xtrole;


--
-- Name: urlinfo_url_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE urlinfo_url_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE urlinfo_url_id_seq FROM admin;
GRANT ALL ON SEQUENCE urlinfo_url_id_seq TO admin;
GRANT ALL ON SEQUENCE urlinfo_url_id_seq TO xtrole;


--
-- Name: usrpref; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE usrpref FROM PUBLIC;
REVOKE ALL ON TABLE usrpref FROM admin;
GRANT ALL ON TABLE usrpref TO admin;
GRANT ALL ON TABLE usrpref TO xtrole;


--
-- Name: usr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE usr FROM PUBLIC;
REVOKE ALL ON TABLE usr FROM admin;
GRANT ALL ON TABLE usr TO admin;
GRANT ALL ON TABLE usr TO xtrole;


--
-- Name: usr_bak; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE usr_bak FROM PUBLIC;
REVOKE ALL ON TABLE usr_bak FROM admin;
GRANT ALL ON TABLE usr_bak TO admin;
GRANT ALL ON TABLE usr_bak TO xtrole;


--
-- Name: usr_usr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE usr_usr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE usr_usr_id_seq FROM admin;
GRANT ALL ON SEQUENCE usr_usr_id_seq TO admin;
GRANT ALL ON SEQUENCE usr_usr_id_seq TO xtrole;


--
-- Name: usrgrp_usrgrp_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE usrgrp_usrgrp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE usrgrp_usrgrp_id_seq FROM admin;
GRANT ALL ON SEQUENCE usrgrp_usrgrp_id_seq TO admin;
GRANT ALL ON SEQUENCE usrgrp_usrgrp_id_seq TO xtrole;


--
-- Name: usrpref_usrpref_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE usrpref_usrpref_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE usrpref_usrpref_id_seq FROM admin;
GRANT ALL ON SEQUENCE usrpref_usrpref_id_seq TO admin;
GRANT ALL ON SEQUENCE usrpref_usrpref_id_seq TO xtrole;


--
-- Name: usrpriv_usrpriv_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE usrpriv_usrpriv_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE usrpriv_usrpriv_id_seq FROM admin;
GRANT ALL ON SEQUENCE usrpriv_usrpriv_id_seq TO admin;
GRANT ALL ON SEQUENCE usrpriv_usrpriv_id_seq TO xtrole;


--
-- Name: vend; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vend FROM PUBLIC;
REVOKE ALL ON TABLE vend FROM admin;
GRANT ALL ON TABLE vend TO admin;
GRANT ALL ON TABLE vend TO xtrole;


--
-- Name: vend_vend_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE vend_vend_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE vend_vend_id_seq FROM admin;
GRANT ALL ON SEQUENCE vend_vend_id_seq TO admin;
GRANT ALL ON SEQUENCE vend_vend_id_seq TO xtrole;


--
-- Name: vendaddr; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vendaddr FROM PUBLIC;
REVOKE ALL ON TABLE vendaddr FROM admin;
GRANT ALL ON TABLE vendaddr TO admin;
GRANT ALL ON TABLE vendaddr TO xtrole;


--
-- Name: vendaddr_vendaddr_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE vendaddr_vendaddr_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE vendaddr_vendaddr_id_seq FROM admin;
GRANT ALL ON SEQUENCE vendaddr_vendaddr_id_seq TO admin;
GRANT ALL ON SEQUENCE vendaddr_vendaddr_id_seq TO xtrole;


--
-- Name: vendtype_vendtype_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE vendtype_vendtype_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE vendtype_vendtype_id_seq FROM admin;
GRANT ALL ON SEQUENCE vendtype_vendtype_id_seq TO admin;
GRANT ALL ON SEQUENCE vendtype_vendtype_id_seq TO xtrole;


--
-- Name: vodist; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vodist FROM PUBLIC;
REVOKE ALL ON TABLE vodist FROM admin;
GRANT ALL ON TABLE vodist TO admin;
GRANT ALL ON TABLE vodist TO xtrole;


--
-- Name: vodist_vodist_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE vodist_vodist_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE vodist_vodist_id_seq FROM admin;
GRANT ALL ON SEQUENCE vodist_vodist_id_seq TO admin;
GRANT ALL ON SEQUENCE vodist_vodist_id_seq TO xtrole;


--
-- Name: vohead; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE vohead FROM PUBLIC;
REVOKE ALL ON TABLE vohead FROM admin;
GRANT ALL ON TABLE vohead TO admin;
GRANT ALL ON TABLE vohead TO xtrole;


--
-- Name: vohead_vohead_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE vohead_vohead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE vohead_vohead_id_seq FROM admin;
GRANT ALL ON SEQUENCE vohead_vohead_id_seq TO admin;
GRANT ALL ON SEQUENCE vohead_vohead_id_seq TO xtrole;


--
-- Name: voheadtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE voheadtax FROM PUBLIC;
REVOKE ALL ON TABLE voheadtax FROM admin;
GRANT ALL ON TABLE voheadtax TO admin;
GRANT ALL ON TABLE voheadtax TO xtrole;


--
-- Name: voitem; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE voitem FROM PUBLIC;
REVOKE ALL ON TABLE voitem FROM admin;
GRANT ALL ON TABLE voitem TO admin;
GRANT ALL ON TABLE voitem TO xtrole;


--
-- Name: voitem_voitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE voitem_voitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE voitem_voitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE voitem_voitem_id_seq TO admin;
GRANT ALL ON SEQUENCE voitem_voitem_id_seq TO xtrole;


--
-- Name: voitemtax; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE voitemtax FROM PUBLIC;
REVOKE ALL ON TABLE voitemtax FROM admin;
GRANT ALL ON TABLE voitemtax TO admin;
GRANT ALL ON TABLE voitemtax TO xtrole;


--
-- Name: warehous; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE warehous FROM PUBLIC;
REVOKE ALL ON TABLE warehous FROM admin;
GRANT ALL ON TABLE warehous TO admin;
GRANT ALL ON TABLE warehous TO xtrole;


--
-- Name: warehous_warehous_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE warehous_warehous_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE warehous_warehous_id_seq FROM admin;
GRANT ALL ON SEQUENCE warehous_warehous_id_seq TO admin;
GRANT ALL ON SEQUENCE warehous_warehous_id_seq TO xtrole;


--
-- Name: whsezone_whsezone_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE whsezone_whsezone_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE whsezone_whsezone_id_seq FROM admin;
GRANT ALL ON SEQUENCE whsezone_whsezone_id_seq TO admin;
GRANT ALL ON SEQUENCE whsezone_whsezone_id_seq TO xtrole;


--
-- Name: wo; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE wo FROM PUBLIC;
REVOKE ALL ON TABLE wo FROM admin;
GRANT ALL ON TABLE wo TO admin;
GRANT ALL ON TABLE wo TO xtrole;


--
-- Name: wo_wo_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE wo_wo_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE wo_wo_id_seq FROM admin;
GRANT ALL ON SEQUENCE wo_wo_id_seq TO admin;
GRANT ALL ON SEQUENCE wo_wo_id_seq TO xtrole;


--
-- Name: womatl_womatl_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE womatl_womatl_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE womatl_womatl_id_seq FROM admin;
GRANT ALL ON SEQUENCE womatl_womatl_id_seq TO admin;
GRANT ALL ON SEQUENCE womatl_womatl_id_seq TO xtrole;


--
-- Name: womatlpost; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE womatlpost FROM PUBLIC;
REVOKE ALL ON TABLE womatlpost FROM admin;
GRANT ALL ON TABLE womatlpost TO admin;
GRANT ALL ON TABLE womatlpost TO xtrole;


--
-- Name: womatlpost_womatlpost_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE womatlpost_womatlpost_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE womatlpost_womatlpost_id_seq FROM admin;
GRANT ALL ON SEQUENCE womatlpost_womatlpost_id_seq TO admin;
GRANT ALL ON SEQUENCE womatlpost_womatlpost_id_seq TO xtrole;


--
-- Name: womatlvar; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE womatlvar FROM PUBLIC;
REVOKE ALL ON TABLE womatlvar FROM admin;
GRANT ALL ON TABLE womatlvar TO admin;
GRANT ALL ON TABLE womatlvar TO xtrole;


--
-- Name: womatlvar_womatlvar_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE womatlvar_womatlvar_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE womatlvar_womatlvar_id_seq FROM admin;
GRANT ALL ON SEQUENCE womatlvar_womatlvar_id_seq TO admin;
GRANT ALL ON SEQUENCE womatlvar_womatlvar_id_seq TO xtrole;


--
-- Name: xcalitem_xcalitem_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE xcalitem_xcalitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE xcalitem_xcalitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE xcalitem_xcalitem_id_seq TO admin;
GRANT ALL ON SEQUENCE xcalitem_xcalitem_id_seq TO xtrole;


--
-- Name: xsltmap; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE xsltmap FROM PUBLIC;
REVOKE ALL ON TABLE xsltmap FROM admin;
GRANT ALL ON TABLE xsltmap TO admin;
GRANT ALL ON TABLE xsltmap TO xtrole;


--
-- Name: xsltmap_xsltmap_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE xsltmap_xsltmap_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE xsltmap_xsltmap_id_seq FROM admin;
GRANT ALL ON SEQUENCE xsltmap_xsltmap_id_seq TO admin;
GRANT ALL ON SEQUENCE xsltmap_xsltmap_id_seq TO xtrole;


--
-- Name: yearperiod; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON TABLE yearperiod FROM PUBLIC;
REVOKE ALL ON TABLE yearperiod FROM admin;
GRANT ALL ON TABLE yearperiod TO admin;
GRANT ALL ON TABLE yearperiod TO xtrole;


--
-- Name: yearperiod_yearperiod_id_seq; Type: ACL; Schema: public; Owner: admin
--

REVOKE ALL ON SEQUENCE yearperiod_yearperiod_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE yearperiod_yearperiod_id_seq FROM admin;
GRANT ALL ON SEQUENCE yearperiod_yearperiod_id_seq TO admin;
GRANT ALL ON SEQUENCE yearperiod_yearperiod_id_seq TO xtrole;



--
-- Name: pkgcmd; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgcmd FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmd FROM admin;
GRANT ALL ON TABLE pkgcmd TO admin;
GRANT ALL ON TABLE pkgcmd TO xtrole;


--
-- Name: pkgcmdarg; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgcmdarg FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmdarg FROM admin;
GRANT ALL ON TABLE pkgcmdarg TO admin;
GRANT ALL ON TABLE pkgcmdarg TO xtrole;


--
-- Name: pkgimage; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgimage FROM PUBLIC;
REVOKE ALL ON TABLE pkgimage FROM admin;
GRANT ALL ON TABLE pkgimage TO admin;
GRANT ALL ON TABLE pkgimage TO xtrole;


--
-- Name: pkgmetasql; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgmetasql FROM PUBLIC;
REVOKE ALL ON TABLE pkgmetasql FROM admin;
GRANT ALL ON TABLE pkgmetasql TO admin;
GRANT ALL ON TABLE pkgmetasql TO xtrole;


--
-- Name: pkgpriv; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgpriv FROM PUBLIC;
REVOKE ALL ON TABLE pkgpriv FROM admin;
GRANT ALL ON TABLE pkgpriv TO admin;
GRANT ALL ON TABLE pkgpriv TO xtrole;


--
-- Name: pkgreport; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgreport FROM PUBLIC;
REVOKE ALL ON TABLE pkgreport FROM admin;
GRANT ALL ON TABLE pkgreport TO admin;
GRANT ALL ON TABLE pkgreport TO xtrole;


--
-- Name: pkgscript; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkgscript FROM PUBLIC;
REVOKE ALL ON TABLE pkgscript FROM admin;
GRANT ALL ON TABLE pkgscript TO admin;
GRANT ALL ON TABLE pkgscript TO xtrole;


--
-- Name: pkguiform; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE pkguiform FROM PUBLIC;
REVOKE ALL ON TABLE pkguiform FROM admin;
GRANT ALL ON TABLE pkguiform TO admin;
GRANT ALL ON TABLE pkguiform TO xtrole;


--
-- Name: tecustrate; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE tecustrate FROM PUBLIC;
REVOKE ALL ON TABLE tecustrate FROM admin;
GRANT ALL ON TABLE tecustrate TO admin;
GRANT ALL ON TABLE tecustrate TO xtrole;


--
-- Name: tecustrate_tecustrate_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE tecustrate_tecustrate_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE tecustrate_tecustrate_id_seq FROM admin;
GRANT ALL ON SEQUENCE tecustrate_tecustrate_id_seq TO admin;
GRANT ALL ON SEQUENCE tecustrate_tecustrate_id_seq TO xtrole;


--
-- Name: teemp; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE teemp FROM PUBLIC;
REVOKE ALL ON TABLE teemp FROM admin;
GRANT ALL ON TABLE teemp TO admin;
GRANT ALL ON TABLE teemp TO xtrole;


--
-- Name: teemp_teemp_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE teemp_teemp_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE teemp_teemp_id_seq FROM admin;
GRANT ALL ON SEQUENCE teemp_teemp_id_seq TO admin;
GRANT ALL ON SEQUENCE teemp_teemp_id_seq TO xtrole;


--
-- Name: teexp; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE teexp FROM PUBLIC;
REVOKE ALL ON TABLE teexp FROM admin;
GRANT ALL ON TABLE teexp TO admin;
GRANT ALL ON TABLE teexp TO xtrole;


--
-- Name: timesheet_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE timesheet_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE timesheet_seq FROM admin;
GRANT ALL ON SEQUENCE timesheet_seq TO admin;
GRANT ALL ON SEQUENCE timesheet_seq TO xtrole;


--
-- Name: tehead; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE tehead FROM PUBLIC;
REVOKE ALL ON TABLE tehead FROM admin;
GRANT ALL ON TABLE tehead TO admin;
GRANT ALL ON TABLE tehead TO xtrole;


--
-- Name: tehead_tehead_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE tehead_tehead_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE tehead_tehead_id_seq FROM admin;
GRANT ALL ON SEQUENCE tehead_tehead_id_seq TO admin;
GRANT ALL ON SEQUENCE tehead_tehead_id_seq TO xtrole;


--
-- Name: teitem; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE teitem FROM PUBLIC;
REVOKE ALL ON TABLE teitem FROM admin;
GRANT ALL ON TABLE teitem TO admin;
GRANT ALL ON TABLE teitem TO xtrole;


--
-- Name: teitem_teitem_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE teitem_teitem_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE teitem_teitem_id_seq FROM admin;
GRANT ALL ON SEQUENCE teitem_teitem_id_seq TO admin;
GRANT ALL ON SEQUENCE teitem_teitem_id_seq TO xtrole;


--
-- Name: teprj; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE teprj FROM PUBLIC;
REVOKE ALL ON TABLE teprj FROM admin;
GRANT ALL ON TABLE teprj TO admin;
GRANT ALL ON TABLE teprj TO xtrole;


--
-- Name: teprj_teprj_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE teprj_teprj_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE teprj_teprj_id_seq FROM admin;
GRANT ALL ON SEQUENCE teprj_teprj_id_seq TO admin;
GRANT ALL ON SEQUENCE teprj_teprj_id_seq TO xtrole;


--
-- Name: teprjtask; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON TABLE teprjtask FROM PUBLIC;
REVOKE ALL ON TABLE teprjtask FROM admin;
GRANT ALL ON TABLE teprjtask TO admin;
GRANT ALL ON TABLE teprjtask TO xtrole;


--
-- Name: teprjtask_teprjtask_id_seq; Type: ACL; Schema: te; Owner: admin
--

REVOKE ALL ON SEQUENCE teprjtask_teprjtask_id_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE teprjtask_teprjtask_id_seq FROM admin;
GRANT ALL ON SEQUENCE teprjtask_teprjtask_id_seq TO admin;
GRANT ALL ON SEQUENCE teprjtask_teprjtask_id_seq TO xtrole;



--
-- Name: js; Type: ACL; Schema: xt; Owner: admin
--

REVOKE ALL ON TABLE js FROM PUBLIC;
REVOKE ALL ON TABLE js FROM admin;
GRANT ALL ON TABLE js TO admin;
GRANT ALL ON TABLE js TO xtrole;



--
-- Name: pkgcmd; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgcmd FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmd FROM admin;
GRANT ALL ON TABLE pkgcmd TO admin;
GRANT ALL ON TABLE pkgcmd TO xtrole;


--
-- Name: pkgcmdarg; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgcmdarg FROM PUBLIC;
REVOKE ALL ON TABLE pkgcmdarg FROM admin;
GRANT ALL ON TABLE pkgcmdarg TO admin;
GRANT ALL ON TABLE pkgcmdarg TO xtrole;


--
-- Name: pkgimage; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgimage FROM PUBLIC;
REVOKE ALL ON TABLE pkgimage FROM admin;
GRANT ALL ON TABLE pkgimage TO admin;
GRANT ALL ON TABLE pkgimage TO xtrole;


--
-- Name: pkgmetasql; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgmetasql FROM PUBLIC;
REVOKE ALL ON TABLE pkgmetasql FROM admin;
GRANT ALL ON TABLE pkgmetasql TO admin;
GRANT ALL ON TABLE pkgmetasql TO xtrole;


--
-- Name: pkgpriv; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgpriv FROM PUBLIC;
REVOKE ALL ON TABLE pkgpriv FROM admin;
GRANT ALL ON TABLE pkgpriv TO admin;
GRANT ALL ON TABLE pkgpriv TO xtrole;


--
-- Name: pkgreport; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgreport FROM PUBLIC;
REVOKE ALL ON TABLE pkgreport FROM admin;
GRANT ALL ON TABLE pkgreport TO admin;
GRANT ALL ON TABLE pkgreport TO xtrole;


--
-- Name: pkgscript; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkgscript FROM PUBLIC;
REVOKE ALL ON TABLE pkgscript FROM admin;
GRANT ALL ON TABLE pkgscript TO admin;
GRANT ALL ON TABLE pkgscript TO xtrole;


--
-- Name: pkguiform; Type: ACL; Schema: xtdesktop; Owner: admin
--

REVOKE ALL ON TABLE pkguiform FROM PUBLIC;
REVOKE ALL ON TABLE pkguiform FROM admin;
GRANT ALL ON TABLE pkguiform TO admin;
GRANT ALL ON TABLE pkguiform TO xtrole;


--
--

