Re: "timer" script from SAMS book or equivalent? - Mailing list pgsql-general

From John Wells
Subject Re: "timer" script from SAMS book or equivalent?
Date
Msg-id 5187489.2851192020209886.JavaMail.root@cayman.devsea.com
Whole thread Raw
In response to Re: "timer" script from SAMS book or equivalent?  (John Wells <jb@sourceillustrated.com>)
Responses Re: "timer" script from SAMS book or equivalent?
List pgsql-general
Could someone explain to me how the connection is initialized below? I'm re-writing the script in Ruby...but this is a
stumblingblock for me in the way the C++ libs work. Does the library initial conn automagically? How would one emulate
thisin another language...would it be to run it as the postgres user and connection to template1? 

Thanks,
John

int main( int argc, char * argv[] )
{
   // how is this being initialized?
   connection conn;

   work tran1( conn, "getBegValues" );

   const result & begTupleValues = getTupleValues( tran1, argc > 2 ?
argv[2] : 0 );
   const result & begBlockValues = getBlockValues( tran1, argc > 2 ?
argv[2] : 0 );

   const result & ignore = tran1.exec( argv[1] );

   tran1.commit();

   sleep( 1 );

   work tran2( conn, "getEndValues" );

   const result & endTupleValues = getTupleValues( tran2, argc > 2 ?
argv[2] : 0 );
   const result & endBlockValues = getBlockValues( tran2, argc > 2 ?
argv[2] : 0 );

   printDeltas( begTupleValues, endTupleValues, begBlockValues,
endBlockValues );


}

pgsql-general by date:

Previous
From: Owen Hartnett
Date:
Subject: Re: Generating subtotal reports direct from SQL
Next
From: Sam Mason
Date:
Subject: Re: disjoint union types