Created 11-04-2016 01:50 AM
I created a phoenix table with 100 columns. I forgot what the primary key for the table. The primary key was build with at least 5 to 6 columns, can't say for sure. Any easy way to have phoenix tell me what the primary key is on a table?
Created 11-04-2016 03:26 AM
The `SYSTEM.CATLOG` table contains a column called `KEY_SEQ`. If this contains an integer, it's a key column. E.g.
SELECT column_name FROM system.catalog WHERE table_name = '{{ your table name }}' AND key_seq IS NOT NULL;
Created 11-21-2017 09:20 PM
You can try :
0: jdbc:phoenix:> !primarykeys $TABLE_NAME +------------+--------------+-------------+------------------------+----------+----------+--------------+------------+------------+-+ | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | KEY_SEQ | PK_NAME | ASC_OR_DESC | DATA_TYPE | TYPE_NAME | | +------------+--------------+-------------+------------------------+----------+----------+--------------+------------+------------+-+ | | $SCHEMA | $TABLE | col1 | 1 | PK | A | 12 | VARCHAR | | | | $SCHEMA | $TABLE | col2 | 2 | PK | A | 12 | VARCHAR | | +------------+--------------+-------------+------------------------+----------+----------+--------------+------------+------------+-+
Created 06-23-2021 12:47 AM
This doesn't work
Created 06-23-2021 02:41 AM
@Sunny93 as this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post.
Regards,
Vidya Sargur,