SELECT setval('users_id_seq', coalesce((select max(id) from users), 1), true);
SELECT setval('countries_id_seq', coalesce((select max(id) from countries), 1), true);
SELECT setval('location_states_id_seq', coalesce((select max(id) from location_states), 1), true);
SELECT setval('location_districts_id_seq', coalesce((select max(id) from location_districts), 1), true);
SELECT setval('location_boroughs_id_seq', coalesce((select max(id) from location_boroughs), 1), true);
SELECT setval('location_cities_id_seq', coalesce((select max(id) from location_cities), 1), true);
SELECT setval('location_street_types_id_seq', coalesce((select max(id) from location_street_types), 1), true);
SELECT setval('location_streets_id_seq', coalesce((select max(id) from location_streets), 1), true);
SELECT setval('location_buildings_id_seq', coalesce((select max(id) from location_buildings), 1), true);
SELECT setval('addresses_id_seq', coalesce((select max(id) from addresses), 1), true);
SELECT setval('divisions_id_seq', coalesce((select max(id) from divisions), 1), true);
SELECT setval('customers_id_seq', coalesce((select max(id) from customers), 1), true);
SELECT setval('numberplans_id_seq', coalesce((select max(id) from numberplans), 1), true);
SELECT setval('states_id_seq', coalesce((select max(id) from states), 1), true);
SELECT setval('zipcodes_id_seq', coalesce((select max(id) from zipcodes), 1), true);
SELECT setval('customer_addresses_id_seq', coalesce((select max(id) from customer_addresses), 1), true);
SELECT setval('documents_id_seq', coalesce((select max(id) from documents), 1), true);
SELECT setval('documentattachments_id_seq', coalesce((select max(id) from documentattachments), 1), true);
SELECT setval('cashregs_id_seq', coalesce((select max(id) from cashregs), 1), true);
SELECT setval('taxes_id_seq', coalesce((select max(id) from taxes), 1), true);
SELECT setval('voipaccounts_id_seq', coalesce((select max(id) from voipaccounts), 1), true);
SELECT setval('voip_rule_groups_id_seq', coalesce((select max(id) from voip_rule_groups), 1), true);
SELECT setval('voip_prefix_groups_id_seq', coalesce((select max(id) from voip_prefix_groups), 1), true);
SELECT setval('voip_rules_id_seq', coalesce((select max(id) from voip_rules), 1), true);
SELECT setval('voip_tariffs_id_seq', coalesce((select max(id) from voip_tariffs), 1), true);
SELECT setval('voip_rule_states_id_seq', coalesce((select max(id) from voip_rule_states), 1), true);
SELECT setval('voip_prefixes_id_seq', coalesce((select max(id) from voip_prefixes), 1), true);
SELECT setval('voip_cdr_id_seq', coalesce((select max(id) from voip_cdr), 1), true);
SELECT setval('voip_price_groups_id_seq', coalesce((select max(id) from voip_price_groups), 1), true);
SELECT setval('tariffs_id_seq', coalesce((select max(id) from tariffs), 1), true);
SELECT setval('voip_numbers_id_seq', coalesce((select max(id) from voip_numbers), 1), true);
SELECT setval('voip_pool_numbers_id_seq', coalesce((select max(id) from voip_pool_numbers), 1), true);
SELECT setval('liabilities_id_seq', coalesce((select max(id) from liabilities), 1), true);
SELECT setval('assignments_id_seq', coalesce((select max(id) from assignments), 1), true);
SELECT setval('voip_number_assignments_id_seq', coalesce((select max(id) from voip_number_assignments), 1), true);
SELECT setval('debitnotecontents_id_seq', coalesce((select max(id) from debitnotecontents), 1), true);
SELECT setval('cashsources_id_seq', coalesce((select max(id) from cashsources), 1), true);
SELECT setval('sourcefiles_id_seq', coalesce((select max(id) from sourcefiles), 1), true);
SELECT setval('cashimport_id_seq', coalesce((select max(id) from cashimport), 1), true);
SELECT setval('cash_id_seq', coalesce((select max(id) from cash), 1), true);
SELECT setval('pna_id_seq', coalesce((select max(id) from pna), 1), true);
SELECT setval('ewx_channels_id_seq', coalesce((select max(id) from ewx_channels), 1), true);
SELECT setval('ewx_stm_channels_id_seq', coalesce((select max(id) from ewx_stm_channels), 1), true);
SELECT setval('hosts_id_seq', coalesce((select max(id) from hosts), 1), true);
SELECT setval('networks_id_seq', coalesce((select max(id) from networks), 1), true);
SELECT setval('invprojects_id_seq', coalesce((select max(id) from invprojects), 1), true);
SELECT setval('netnodes_id_seq', coalesce((select max(id) from netnodes), 1), true);
SELECT setval('netdeviceproducers_id_seq', coalesce((select max(id) from netdeviceproducers), 1), true);
SELECT setval('netdevicemodels_id_seq', coalesce((select max(id) from netdevicemodels), 1), true);
SELECT setval('netdevices_id_seq', coalesce((select max(id) from netdevices), 1), true);
SELECT setval('netradiosectors_id_seq', coalesce((select max(id) from netradiosectors), 1), true);
SELECT setval('nodes_id_seq', coalesce((select max(id) from nodes), 1), true);
SELECT setval('ewx_stm_nodes_id_seq', coalesce((select max(id) from ewx_stm_nodes), 1), true);
SELECT setval('nodelocks_id_seq', coalesce((select max(id) from nodelocks), 1), true);
SELECT setval('macs_id_seq', coalesce((select max(id) from macs), 1), true);
SELECT setval('nodegroups_id_seq', coalesce((select max(id) from nodegroups), 1), true);
SELECT setval('nodegroupassignments_id_seq', coalesce((select max(id) from nodegroupassignments), 1), true);
SELECT setval('nodeassignments_id_seq', coalesce((select max(id) from nodeassignments), 1), true);
SELECT setval('tarifftags_id_seq', coalesce((select max(id) from tarifftags), 1), true);
SELECT setval('tariffassignments_id_seq', coalesce((select max(id) from tariffassignments), 1), true);
SELECT setval('promotions_id_seq', coalesce((select max(id) from promotions), 1), true);
SELECT setval('promotionschemas_id_seq', coalesce((select max(id) from promotionschemas), 1), true);
SELECT setval('promotionassignments_id_seq', coalesce((select max(id) from promotionassignments), 1), true);
SELECT setval('payments_id_seq', coalesce((select max(id) from payments), 1), true);
SELECT setval('numberplanassignments_id_seq', coalesce((select max(id) from numberplanassignments), 1), true);
SELECT setval('customergroups_id_seq', coalesce((select max(id) from customergroups), 1), true);
SELECT setval('customerassignments_id_seq', coalesce((select max(id) from customerassignments), 1), true);
SELECT setval('nodesessions_id_seq', coalesce((select max(id) from nodesessions), 1), true);
SELECT setval('netlinks_id_seq', coalesce((select max(id) from netlinks), 1), true);
SELECT setval('rtqueues_id_seq', coalesce((select max(id) from rtqueues), 1), true);
SELECT setval('rttickets_id_seq', coalesce((select max(id) from rttickets), 1), true);
SELECT setval('rtmessages_id_seq', coalesce((select max(id) from rtmessages), 1), true);
SELECT setval('rtrights_id_seq', coalesce((select max(id) from rtrights), 1), true);
SELECT setval('rtcategories_id_seq', coalesce((select max(id) from rtcategories), 1), true);
SELECT setval('rtcategoryusers_id_seq', coalesce((select max(id) from rtcategoryusers), 1), true);
SELECT setval('rtticketcategories_id_seq', coalesce((select max(id) from rtticketcategories), 1), true);
SELECT setval('rtqueuecategories_id_seq', coalesce((select max(id) from rtqueuecategories), 1), true);
SELECT setval('domains_id_seq', coalesce((select max(id) from domains), 1), true);
SELECT setval('passwd_id_seq', coalesce((select max(id) from passwd), 1), true);
SELECT setval('records_id_seq', coalesce((select max(id) from records), 1), true);
SELECT setval('supermasters_id_seq', coalesce((select max(id) from supermasters), 1), true);
SELECT setval('comments_id_seq', coalesce((select max(id) from comments), 1), true);
SELECT setval('cryptokeys_id_seq', coalesce((select max(id) from cryptokeys), 1), true);
SELECT setval('tsigkeys_id_seq', coalesce((select max(id) from tsigkeys), 1), true);
SELECT setval('aliases_id_seq', coalesce((select max(id) from aliases), 1), true);
SELECT setval('aliasassignments_id_seq', coalesce((select max(id) from aliasassignments), 1), true);
SELECT setval('uiconfig_id_seq', coalesce((select max(id) from uiconfig), 1), true);
SELECT setval('events_id_seq', coalesce((select max(id) from events), 1), true);
SELECT setval('daemoninstances_id_seq', coalesce((select max(id) from daemoninstances), 1), true);
SELECT setval('daemonconfig_id_seq', coalesce((select max(id) from daemonconfig), 1), true);
SELECT setval('docrights_id_seq', coalesce((select max(id) from docrights), 1), true);
SELECT setval('cashrights_id_seq', coalesce((select max(id) from cashrights), 1), true);
SELECT setval('cashreglog_id_seq', coalesce((select max(id) from cashreglog), 1), true);
SELECT setval('ewx_pt_config_id_seq', coalesce((select max(id) from ewx_pt_config), 1), true);
SELECT setval('customercontacts_id_seq', coalesce((select max(id) from customercontacts), 1), true);
SELECT setval('excludedgroups_id_seq', coalesce((select max(id) from excludedgroups), 1), true);
SELECT setval('messages_id_seq', coalesce((select max(id) from messages), 1), true);
SELECT setval('messageitems_id_seq', coalesce((select max(id) from messageitems), 1), true);
SELECT setval('nastypes_id_seq', coalesce((select max(id) from nastypes), 1), true);
SELECT setval('managementurls_id_seq', coalesce((select max(id) from managementurls), 1), true);
SELECT setval('logtransactions_id_seq', coalesce((select max(id) from logtransactions), 1), true);
SELECT setval('logmessages_id_seq', coalesce((select max(id) from logmessages), 1), true);
SELECT setval('templates_id_seq', coalesce((select max(id) from templates), 1), true);
SELECT setval('usergroups_id_seq', coalesce((select max(id) from usergroups), 1), true);
SELECT setval('userassignments_id_seq', coalesce((select max(id) from userassignments), 1), true);
SELECT setval('passwdhistory_id_seq', coalesce((select max(id) from passwdhistory), 1), true);
SELECT setval('up_rights_id_seq', coalesce((select max(id) from up_rights), 1), true);
SELECT setval('up_rights_assignments_id_seq', coalesce((select max(id) from up_rights_assignments), 1), true);
SELECT setval('up_customers_id_seq', coalesce((select max(id) from up_customers), 1), true);
SELECT setval('up_help_id_seq', coalesce((select max(id) from up_help), 1), true);
SELECT setval('up_info_changes_id_seq', coalesce((select max(id) from up_info_changes), 1), true);