Gateway Database Queries
Some simple Queries to gather information
Who is registered on my gateway?
SELECT user_cs, regist_rp_cs FROM sync_rip where regist_rp_cs = '<your gateway callsign>' and user_cs <> regist_rp_cs order by user_cs;
Where is this user registered?
SELECT user_cs, regist_rp_cs FROM sync_rip where del_flg = 'f' and user_cs = '<user callsign>' ;
What repeater has a user last been seen on?
SELECT zonerp_cs from sync_mng WHERE del_flg = 'f' and target_cs = '<user callsign>';
Who has not been OK'd for registration on your local system?
select user_cs, e_mail from unsync_user_mng where regist_flg = 'f';
Are any of your local users already registered on another gateway?
select user_cs, regist_rp_cs from sync_rip where regist_rp_cs not in ( select user_cs from unsync_user_mng where admin_flg = 't' ) and user_cs in ( select user_cs from unsync_user_mng where admin_flg = 'f') and del_flg = 'f';
Best method for allowing direct access to any of this information is to setup a database replication sceme.
You want to do a pg_dump, and scp off the database, and on a remote webserver, pg_restore the database, and use apache on that server, this will limit user access to your gateway box.
William Stillwell - ki4swy

