Index: trunk/pstamp/scripts/pstamp_queue_requests.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_queue_requests.pl	(revision 21410)
+++ trunk/pstamp/scripts/pstamp_queue_requests.pl	(revision 24831)
@@ -17,4 +17,5 @@
 my $verbose;
 my $dbname;
+my $dbserver;
 my $limit;
 
@@ -22,4 +23,5 @@
     'verbose'       =>  \$verbose,
     'dbname=s'      =>  \$dbname,
+    'dbserver=s'    =>  \$dbserver,
     'limit=i'       =>  \$limit,
 );
@@ -59,5 +61,10 @@
 }
 
+my $ipprc = PS::IPP::Config->new();
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
+
+if (!$dbserver) {
+    $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
+}
 
 my @dataStores;
@@ -66,4 +73,5 @@
     my $command = "$pstamptool -datastore";
     $command .= " -dbname $dbname" if $dbname;
+    $command .= " -dbserver $dbserver" if $dbserver;
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -177,4 +185,5 @@
                 my $command = "$pstamptool -addreq -uri $req_uri -ds_id $ds_id";
                 $command .= " -dbname $dbname" if $dbname;
+                $command .= " -dbserver $dbserver" if $dbserver;
 
                 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -192,4 +201,5 @@
         my $command = "$pstamptool -ds_id $ds_id -moddatastore -last_fileset $lastFileset";
         $command .= " -dbname $dbname" if $dbname;
+        $command .= " -dbserver $dbserver" if $dbserver;
         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
             run(command => $command, verbose => $verbose);
