Comments (3)
I am not familiar with the python client, but I think there are two problems with that code.
- I think that by default, the python client wraps your commands in a transaction. You should switch it to autocommit mode. As mentioned in the post, the problem doesn't occur inside a transaction.
- Ideally you would use two parameters, as in
INSERT INTO t (p, i) VALUES (@0, @1); CALL f(1, @1);
rather than three. Using three may result in a different behavior, though I'm not sure.
from citus.
I have tried to reproduce this using the below python code. However on both 12.1.0 and 12.1.3, procedure f is called, it throws division by 0 exception and nothing is inserted to the table t. Is anything missing in this code?
cur = conn.cursor()
sql = "CREATE TABLE t (p INT NOT NULL, i INT NOT NULL, PRIMARY KEY (p, i));"
cur.execute(sql);
sql = "SELECT create_distributed_table('t', 'p');"
cur.execute(sql);
conn.commit();
sql = """ CREATE PROCEDURE f(_p INT, _i INT) LANGUAGE plpgsql AS
$$ BEGIN SELECT i / 0 FROM t WHERE p = _p AND i = _i; END; $$;"""
cur.execute(sql);
conn.commit();
sql = "SELECT create_distributed_function('f(INT,INT)', distribution_arg_name := '_p', colocate_with := 't');"
cur.execute(sql);
conn.commit();
sql = "INSERT INTO t (p, i) VALUES (%s, %s); CALL f(1, %s);"
cur.execute(sql,(1,2,2))
conn.commit();
from citus.
Any luck reproducing this?
from citus.
Related Issues (20)
- Can't add entry for certificate authentication to pg_dist_authinfo HOT 2
- SQL Error [XX000]: ERROR: cache lookup failed for type 0 with pg auto explain HOT 2
- Load data to a table but different sum shards size in worker nodes HOT 1
- Patch for adding support for Rocky Linux to rpm.sh HOT 1
- High Availability improvements coming? Use Replicas for reads?
- postgres[495645]: segfault at 0 ip 00007f318b17e1f4 sp 00007ffc7f1b15d8 error 4 in citus.so[7f318b0a4000+ee000] likely on CPU 93 (core 1, socket 1) HOT 5
- PostgreSQL 17 support HOT 1
- wrong one
- Execution order of statements of a transaction HOT 1
- pg_stats_user_tables last_autovacuum for distrubuted tables HOT 3
- Having error while using checkout v4 action in check-sql-snapshots
- Debezium support HOT 2
- [Feature request] Worker nodes read only mode HOT 1
- looks like Issue with MERGE Command. HOT 1
- [doc] wrong code comments for function PopUnassignedPlacementExecution HOT 1
- [Feature question] CDC support in Citus
- `alter_table_set_access_method` AccessExclusiveLock HOT 2
- ERROR: no binary output function available for type theta_sketch HOT 4
- Distributed transactions under a concurrency scenario HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citus.