citusdata / citusdata/citus

Using citus_tables in transactions may result in warning regarding citus size functions

Open
#4,839 1 comment 0 reactions 0 assignees View on GitHub
usability
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

Steps to repro:

```SQL
create table t1(a int);
CREATE TABLE
Time: 3.252 ms
create table t2(a int);
CREATE TABLE
Time: 3.115 ms
SELECT create_distributed_table('t1', 'a');
create_distributed_table
--------------------------

(1 row)

Time: 33.936 ms
SELECT create_distributed_table('t2', 'a');
create_distributed_table
--------------------------

(1 row)

Time: 31.148 ms
select alter_table_set_access_method(table_name, 'columnar') FROM citus_tables;
NOTICE: creating a new table for public.t1
NOTICE: moving the data of public.t1
NOTICE: dropping the old public.t1
NOTICE: renaming the new table to public.t1
**WARNING: citus size functions cannot be called in transaction blocks which contain multi-shard data modifications**
NOTICE: creating a new table for public.t2
NOTICE: moving the data of public.t2
NOTICE: dropping the old public.t2
NOTICE: renaming the new table to public.t2
alter_table_set_access_method
-------------------------------


(2 rows)

Time: 191.013 ms
```

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.