citusdata / citusdata/citus

cannot create distributed table that depends on an object created by an extension that's created in the same transaction

Open
#8,472 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

I was testing Elastic Clusters, i.e., our offering on Azure today, with https://github.com/secp256k1-sha256/postgres-compatibility-index/ on https://github.com/secp256k1-sha256/postgres-compatibility-index/commit/dea631491f725ca658b080381011cd69c631fa19.
For ease of testing, used schema-distributed tables but this bug also applies to usual distributed tables etc.

```sql
select citus_version();
┌───────────────────────────────────────────────────────────────────────────────────────────┐
│ citus_version │
├───────────────────────────────────────────────────────────────────────────────────────────┤
│ Citus 13.2.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit gitref: v13.2.0 │
└───────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)
```

Initial setup;
```sql
SET citus.enable_schema_based_sharding TO ON;
CREATE SCHEMA pci_test;
RESET citus.enable_schema_based_sharding;
SET search_path TO pci_test;
```

Reproduce with postgis:
```sql
BEGIN;
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE TABLE test_geo (geom GEOMETRY);
ERROR: type "pci_test.geometry" does not exist
CONTEXT: while executing command on 10.33.0.254:7002
```

Reproduce with pgvector:
```sql
BEGIN;
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE test_vector (embedding VECTOR(3));
ERROR: type "pci_test.vector" does not exist
CONTEXT: while executing command on 10.33.0.254:7002
```

Reproduce with btree_gist:
```sql
BEGIN;
CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE TABLE test_exclusion (id int, t text, ts tstzrange, exclude using gist ((case when t ='A' THEN true end) with =,ts with && ));
ERROR: data type boolean has no default operator class for access method "gist"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
CONTEXT: while executing command on 10.33.0.254:7002
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.