Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

Visibility of Data in System Tables and Views

There are two classes of visibility for data in system tables and views: visible to users and visible to superusers.

Only users with superuser privileges can see the data in those tables that are in the superuser-visible category. Regular users can see data in the user-visible tables. To give a regular user access to superuser-visible tables, GRANT SELECT privilege on that table to the regular user.

By default, in most user-visible tables, rows generated by another user are invisible to a regular user. If a regular user is given unrestricted SYSLOG ACCESS, that user can see all rows in user-visible tables, including rows generated by another user. For more information, see ALTER USER or CREATE USER. All rows in STV_RECENTS and SVV_TRANSACTIONS are visible to all users.

Note

Giving a user unrestricted access to system tables gives the user visibility to data generated by other users. For example, STL_QUERY and STL_QUERY_TEXT contain the full text of INSERT, UPDATE, and DELETE statements, which might contain sensitive user-generated data.

A superuser can see all rows in all tables. To give a regular user access to superuser-visible tables, GRANT SELECT privilege on that table to the regular user.

Filtering System-Generated Queries

The query-related system tables and views, such as SVL_QUERY_SUMMARY, SVL_QLOG, and others, usually contain a large number of automatically generated statements that Amazon Redshift uses to monitor the status of the database. These system-generated queries are visible to a superuser, but are seldom useful. To filter them out when selecting from a system table or system view that uses the userid column, add the condition userid > 1 to the WHERE clause. For example:

Copy
select * from svl_query_summary where userid > 1