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


Use the STV_SESSIONS table to view information about the active user sessions for Amazon Redshift.

To view session history, use the STL_SESSIONS table instead of STV_SESSIONS.

All rows in STV_SESSIONS, including rows generated by another user, are visible to all users.

Table Columns

Column Name Data Type Description
starttime timestamp Time that the session started.
process integer Process ID for the session.
user_name character(50) User associated with the session.
db_name character(50) Name of the database associated with the session.

Sample Queries

To perform a quick check to see if any other users are currently logged into Amazon Redshift, type the following query:

select count(*) from stv_sessions;

If the result is greater than one, then at least one other user is currently logged into the database.

To view all active sessions for Amazon Redshift, type the following query:

select * from stv_sessions;

The sample query output below shows three active sessions currently running on Amazon Redshift:

starttime | process |user_name | db_name -----------------------+---------+----------+---------------- 2008-08-06 08:54:20.50 | 19829 | dwuser | dev 2008-08-06 08:56:34.50 | 20279 | dwuser | dev 2008-08-06 08:55:00.50 | 19996 | dwuser | tickit (3 rows)