Skip to content

Commit 6e95524

Browse files
author
Jesse Seldess
committed
Add known limitation around dropping interleaved indexes
1 parent be63167 commit 6e95524

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

v1.0/known-limitations.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,41 @@ Also, a prepared [`INSERT`](insert.html), [`UPSERT`](upsert.html), or [`DELETE`]
280280

281281
- If the number of columns has increased, the prepared statement returns an error but nonetheless writes the data.
282282
- If the number of columns remains the same but the types have changed, the prepared statement writes the data and does not return an error.
283+
284+
## Dropping an interleaved index prevents DDL operations
285+
286+
When you [drop an interleaved index](drop-index.html) on a table, future DDL operations on the table will fail, for example:
287+
288+
~~~ sql
289+
> CREATE TABLE t1 (id1 INT PRIMARY KEY, id2 INT, id3 INT);
290+
291+
> CREATE INDEX c ON t1 (id2)
292+
STORING (id1, id3)
293+
INTERLEAVE IN PARENT t1 (id2);
294+
295+
> DROP INDEX t1@c;
296+
~~~
297+
298+
~~~ sql
299+
> DROP TABLE t1;
300+
~~~
301+
302+
~~~
303+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
304+
~~~
305+
306+
~~~ sql
307+
> TRUNCATE TABLE t1;
308+
~~~
309+
310+
~~~
311+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
312+
~~~
313+
314+
~~~ sql
315+
> ALTER TABLE t1 RENAME COLUMN id3 TO id4;
316+
~~~
317+
318+
~~~
319+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
320+
~~~

v1.1/known-limitations.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,41 @@ Also, a prepared [`INSERT`](insert.html), [`UPSERT`](upsert.html), or [`DELETE`]
201201

202202
- If the number of columns has increased, the prepared statement returns an error but nonetheless writes the data.
203203
- If the number of columns remains the same but the types have changed, the prepared statement writes the data and does not return an error.
204+
205+
## Dropping an interleaved index prevents DDL operations
206+
207+
When you [drop an interleaved index](drop-index.html) on a table, future DDL operations on the table will fail, for example:
208+
209+
~~~ sql
210+
> CREATE TABLE t1 (id1 INT PRIMARY KEY, id2 INT, id3 INT);
211+
212+
> CREATE INDEX c ON t1 (id2)
213+
STORING (id1, id3)
214+
INTERLEAVE IN PARENT t1 (id2);
215+
216+
> DROP INDEX t1@c;
217+
~~~
218+
219+
~~~ sql
220+
> DROP TABLE t1;
221+
~~~
222+
223+
~~~
224+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
225+
~~~
226+
227+
~~~ sql
228+
> TRUNCATE TABLE t1;
229+
~~~
230+
231+
~~~
232+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
233+
~~~
234+
235+
~~~ sql
236+
> ALTER TABLE t1 RENAME COLUMN id3 TO id4;
237+
~~~
238+
239+
~~~
240+
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
241+
~~~

0 commit comments

Comments
 (0)