Emmanuel BENOîT
3e109b13bc
* Added user mapping on the "remote" logging database for the administrative user. This allows calls to sys.write_sql_log() to succeed when they are executed by code with administrative privileges. * Added test suites for both the link to the database and the function itself. * Replaced RAISE NOTICE with actual logging in the universe generator
29 lines
No EOL
681 B
PL/PgSQL
29 lines
No EOL
681 B
PL/PgSQL
/*
|
|
* Test privileges on sys.logs
|
|
*/
|
|
BEGIN;
|
|
SELECT plan( 4 );
|
|
|
|
SELECT diag_test_name( 'sys.logs - INSERT privileges' );
|
|
SELECT throws_ok(
|
|
$$ INSERT INTO sys.logs( component , level , message )
|
|
VALUES ( 'test' , 'WARNING'::log_level , 'test' );
|
|
$$ , 42501 );
|
|
|
|
SELECT diag_test_name( 'sys.logs - UPDATE privileges' );
|
|
SELECT throws_ok(
|
|
$$ UPDATE sys.logs SET component = 'retest'; $$ ,
|
|
42501 );
|
|
|
|
SELECT diag_test_name( 'sys.logs - SELECT privileges' );
|
|
SELECT lives_ok(
|
|
$$ SELECT * FROM sys.logs; $$
|
|
);
|
|
|
|
SELECT diag_test_name( 'sys.logs - DELETE privileges' );
|
|
SELECT throws_ok(
|
|
$$ DELETE FROM sys.logs; $$ ,
|
|
42501 );
|
|
|
|
SELECT * FROM finish( );
|
|
ROLLBACK; |