mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
fix(ekosystem): register_tenant — RETURN QUERY + smallint cast
INSERT ... RETURNING needs RETURN QUERY in PL/pgSQL RETURNS TABLE functions. tenant_id column is smallint in knoe.tenants; cast to integer to match the function's declared return type. Reproduced on pg.prole.org at 2026-05-30 during Phase 2 canary deploy. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d114801758
commit
23cf4a8585
@ -179,11 +179,10 @@ BEGIN
|
|||||||
|
|
||||||
v_uuid := knoe.ekosystem_id(0, 0); -- root authority mints the UUID
|
v_uuid := knoe.ekosystem_id(0, 0); -- root authority mints the UUID
|
||||||
|
|
||||||
INSERT INTO knoe.tenants (tenant_id, uuid, name)
|
RETURN QUERY
|
||||||
VALUES (v_tenant_id, v_uuid, p_name)
|
INSERT INTO knoe.tenants (tenant_id, uuid, name)
|
||||||
RETURNING tenants.tenant_id, tenants.uuid, tenants.name;
|
VALUES (v_tenant_id::smallint, v_uuid, p_name)
|
||||||
|
RETURNING tenants.tenant_id::integer, tenants.uuid, tenants.name;
|
||||||
RETURN NEXT;
|
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user