Skip to main content
Question

Renaming flex table should rename keys table as well

  • July 20, 2023
  • 1 reply
  • 3 views

Sergey_Cherepan_1
Forum|alt.badge.img+2

Hi,

There is slightly awkward behaviour of flex table keys table.
Keys table is being created together with flex table, with name

<

table>_keys
When flex table is being moved to other schema, keys table is being moved as well. This is correct.
When flex table is being renamed, keys table is not being renamed.

That leads to rather awkward behaviour when you will rename flex table and move to other schema.

Please ask development to rename keys table together with renaming flex table.

Thank you
Sergey

1 reply

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • August 7, 2023

Yes. it is currently not renaming the keys when running alter. I have raised a new feature request for the same.

testdb=> CREATE FLEX TABLE flex0 (a INT, b VARCHAR);
CREATE TABLE
testdb=> INSERT INTO flex0 VALUES (1, 'x');
-[ RECORD 1 ]
OUTPUT | 1

testdb=> commit;
COMMIT

testdb=> ALTER TABLE flex0 rename to flex_newname;
ALTER TABLE

testdb=> SELECT COMPUTE_FLEXTABLE_KEYS_AND_BUILD_VIEW('flex_newname');

COMPUTE_FLEXTABLE_KEYS_AND_BUILD_VIEW

Please see public.flex0_keys for updated keys
The view public.flex0_view is ready for querying
(1 row)

testdb=>

testdb=> \dt
List of tables
Schema | Name | Kind | Owner | Comment
--------+----------------+-------+---------+---------
public | flex0_keys | table | dbadmin |
public | flex_newname | table | dbadmin |
(2 rows)