8a8b9f07fb
The same approach is used in pkg/statements/sql/table_schema.sql and a sample reproduction for the bug is: CREATE SCHEMA test; CREATE TABLE test.data (id INTEGER PRIMARY KEY, name TEXT); CREATE UNIQUE INDEX "test.data_uniq" ON test.data (name); Only the primary key is shown, and not the index created above.
10 lines
235 B
SQL
10 lines
235 B
SQL
SELECT
|
|
indexname AS index_name,
|
|
pg_size_pretty(pg_table_size(('"' || schemaname || '"."' || indexname || '"')::regclass)) AS index_size,
|
|
indexdef AS index_definition
|
|
FROM
|
|
pg_indexes
|
|
WHERE
|
|
schemaname = $1
|
|
AND tablename = $2
|