How to describe a System table

Moderator: NorbertKrupa

Post Reply
User avatar
Jbaskin
Intermediate
Intermediate
Posts: 61
Joined: Sat Jan 28, 2012 1:21 pm

How to describe a System table

Post by Jbaskin » Thu Aug 09, 2012 12:46 pm

Hi guys,

How do I describe a system table in vsql with the \d meta command?

Code: Select all

dbadmin=> \dS sessions;
                            List of tables
  Schema   |   Name   |  Kind  |         Description         | Comment
-----------+----------+--------+-----------------------------+---------
 v_monitor | sessions | system | Information on each Session |
(1 row)

dbadmin=> \d sessions;
Did not find any relation.
Thanks!

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: How to describe a System table

Post by JimKnicely » Thu Aug 09, 2012 1:35 pm

Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: How to describe a System table

Post by id10t » Thu Aug 09, 2012 2:00 pm

HI!

I'm afraid that `v_monitor.sessions` it's VIEW and not TABLE.

User avatar
Jbaskin
Intermediate
Intermediate
Posts: 61
Joined: Sat Jan 28, 2012 1:21 pm

Re: How to describe a System table

Post by Jbaskin » Thu Aug 09, 2012 2:08 pm

Cool, thanks!

The system_columns table has what I'm looking for:

Code: Select all

dbadmin=> select column_name, data_type from system_columns where table_name = 'sessions';
        column_name         |   data_type
----------------------------+---------------
 node_name                  | varchar(128)
 user_name                  | varchar(128)
 client_hostname            | varchar(128)
 client_pid                 | int
 login_timestamp            | timestamptz
 session_id                 | varchar(80)
 client_label               | varchar(256)
 transaction_start          | timestamptz
 transaction_id             | int
 transaction_description    | varchar(8192)
 statement_start            | timestamptz
 statement_id               | int
 last_statement_duration_us | int
 runtime_priority           | varchar(8192)
 current_statement          | varchar(8192)
 last_statement             | varchar(8192)
 ssl_state                  | varchar(80)
 authentication_method      | varchar(80)
 epoch                      | int
(19 rows)
PS> Is the system_columns a table or view :?:

Post Reply

Return to “vSQL”