/*
 * Test the configuration of the dblink extension from the user's perspective
 */
BEGIN;
	SELECT plan( 3 );
	
	SELECT diag_test_name( 'dblink - Connection' );
	SELECT lives_ok(
		$$ SELECT dblink_connect( 'cn_logging' , 'srv_logging' ) $$
	);
	
	SELECT diag_test_name( 'dblink - Remote user = local user' );
	SELECT is( username , current_user::TEXT )
		FROM dblink( 'cn_logging' , 'SELECT current_user' )
			AS ( username TEXT );

	SELECT diag_test_name( 'dblink - Disconnection' );
	SELECT lives_ok(
		$$ SELECT dblink_disconnect( 'cn_logging' ) $$
	);
	
	SELECT * FROM finish( );
ROLLBACK;