Closed
Description
When SHOW CREATE TABLE is executed on a table with row-level security (RLS), the generated DDL should include the CREATE POLICY statements for those policies, appearing immediately after the column definitions.
It should look like the following:
SHOW CREATE TABLE t1;
table_name | create_statement
-------------+--------------------------------------------------------------
t1 | CREATE TABLE public.t1 (
| rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
| CONSTRAINT t1_pkey PRIMARY KEY (rowid ASC)
| );
| ALTER TABLE public.t1 ENABLE ROW LEVEL SECURITY;
| CREATE POLICY p1 on public.t1;
| CREATE POLICY p2 on public.t1
(1 row)
The \d command is similar to SHOW CREATE TABLE, but is a separate codepath. Updating of that is handled in a separate issue. See CRDB-46367: sql: \d command to include RLS policies
Jira issue: CRDB-45229
Activity