2025-08-29T11:10:29.042275Z TRACE routing ClientRequest {
messages: [
Parse(
Parse {
name: "__pgdog_1",
query: "BEGIN",
modified: true,
},
),
Bind(
Bind {
portal: b"\0",
statement: b"__pgdog_1\0",
codes: [],
params: [],
results: [],
original: None,
},
),
Describe(
Describe {
payload: b"D\0\0\0\x06P\0",
original: Some(
b"D\0\0\0\x06P\0",
),
},
),
Execute(
Execute {
portal: "",
},
),
Parse(
Parse {
name: "__pgdog_2",
query: " SET pgdog.sharding_key TO '10000000-0000-0000-0000-000000000000'",
modified: true,
},
),
Bind(
Bind {
portal: b"\0",
statement: b"__pgdog_2\0",
codes: [],
params: [],
results: [],
original: None,
},
),
Describe(
Describe {
payload: b"D\0\0\0\x06P\0",
original: Some(
b"D\0\0\0\x06P\0",
),
},
),
Execute(
Execute {
portal: "",
},
),
Parse(
Parse {
name: "__pgdog_3",
query: " CREATE SCHEMA IF NOT EXISTS system",
modified: true,
},
),
Bind(
Bind {
portal: b"\0",
statement: b"__pgdog_3\0",
codes: [],
params: [],
results: [],
original: None,
},
),
Describe(
Describe {
payload: b"D\0\0\0\x06P\0",
original: Some(
b"D\0\0\0\x06P\0",
),
},
),
Execute(
Execute {
portal: "",
},
),
Sync(
Sync,
),
],
route: Route {
shard: All,
read: false,
order_by: [],
aggregate: Aggregate {
targets: [],
group_by: [],
},
limit: Limit {
limit: None,
offset: None,
},
lock_session: false,
distinct: None,
},
} to Query(
Route {
shard: All,
read: false,
order_by: [],
aggregate: Aggregate {
targets: [],
group_by: [],
},
limit: Limit {
limit: None,
offset: None,
},
lock_session: false,
distinct: None,
},
)
2025-08-29T11:10:29.042319Z TRACE [172.18.0.5:33632] <-- ErrorResponse {
severity: "ERROR",
code: "58000",
message: "cross-shard queries are disabled",
detail: Some(
"query doesn't have a sharding key",
),
context: None,
file: None,
routine: None,
}
I assume there is no way of simply omitting the column name in order to match on all tables regardless, and force usage of the annotation?
The following prepared statement:
returns an error (and seems to route it to shard All):
With the following configuration:
The same thing happens when using
/* pgdog_sharding_key: ... */in a simple statement.For reference; the tables in this database don't necessarily contain a
tenant_idcolumn, all sharding decisions are made purely using/* pgdog_sharding_key *//SET pgdog.sharding_key. However, I see no other way to define the data_type for the sharding_key than include asharded_tablesentry. Discardingsharded_tablesleads to the same behavior.I assume there is no way of simply omitting the column name in order to match on all tables regardless, and force usage of the annotation?