Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions v1.0/known-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,63 @@ Also, a prepared [`INSERT`](insert.html), [`UPSERT`](upsert.html), or [`DELETE`]

- If the number of columns has increased, the prepared statement returns an error but nonetheless writes the data.
- 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.

## Dropping an index interleaved into another index on the same table

In the unlikely case that you [interleave](interleave-in-parent.html) an index into another index on the same table and then [drop](drop-index.html) the interleaved index, future DDL operations on the table will fail.

For example:

~~~ sql
> CREATE TABLE t1 (id1 INT PRIMARY KEY, id2 INT, id3 INT);
~~~

~~~ sql
> CREATE INDEX c ON t1 (id2)
STORING (id1, id3)
INTERLEAVE IN PARENT t1 (id2);
~~~

~~~ sql
> SHOW INDEXES FROM t1;
~~~

~~~
+-------+---------+--------+-----+--------+-----------+---------+----------+
| Table | Name | Unique | Seq | Column | Direction | Storing | Implicit |
+-------+---------+--------+-----+--------+-----------+---------+----------+
| t1 | primary | true | 1 | id1 | ASC | false | false |
| t1 | c | false | 1 | id2 | ASC | false | false |
| t1 | c | false | 2 | id1 | N/A | true | false |
| t1 | c | false | 3 | id3 | N/A | true | false |
+-------+---------+--------+-----+--------+-----------+---------+----------+
(4 rows)
~~~

~~~ sql
> DROP INDEX t1@c;
~~~

~~~ sql
> DROP TABLE t1;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~

~~~ sql
> TRUNCATE TABLE t1;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~

~~~ sql
> ALTER TABLE t1 RENAME COLUMN id3 TO id4;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~
60 changes: 60 additions & 0 deletions v1.1/known-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,63 @@ Also, a prepared [`INSERT`](insert.html), [`UPSERT`](upsert.html), or [`DELETE`]

- If the number of columns has increased, the prepared statement returns an error but nonetheless writes the data.
- 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.

## Dropping an index interleaved into another index on the same table

In the unlikely case that you [interleave](interleave-in-parent.html) an index into another index on the same table and then [drop](drop-index.html) the interleaved index, future DDL operations on the table will fail.

For example:

~~~ sql
> CREATE TABLE t1 (id1 INT PRIMARY KEY, id2 INT, id3 INT);
~~~

~~~ sql
> CREATE INDEX c ON t1 (id2)
STORING (id1, id3)
INTERLEAVE IN PARENT t1 (id2);
~~~

~~~ sql
> SHOW INDEXES FROM t1;
~~~

~~~
+-------+---------+--------+-----+--------+-----------+---------+----------+
| Table | Name | Unique | Seq | Column | Direction | Storing | Implicit |
+-------+---------+--------+-----+--------+-----------+---------+----------+
| t1 | primary | true | 1 | id1 | ASC | false | false |
| t1 | c | false | 1 | id2 | ASC | false | false |
| t1 | c | false | 2 | id1 | N/A | true | false |
| t1 | c | false | 3 | id3 | N/A | true | false |
+-------+---------+--------+-----+--------+-----------+---------+----------+
(4 rows)
~~~

~~~ sql
> DROP INDEX t1@c;
~~~

~~~ sql
> DROP TABLE t1;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~

~~~ sql
> TRUNCATE TABLE t1;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~

~~~ sql
> ALTER TABLE t1 RENAME COLUMN id3 TO id4;
~~~

~~~
pq: invalid interleave backreference table=t1 index=3: index-id "3" does not exist
~~~