pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Truncated functions in grants

Open FFX3 opened this issue 10 months ago • 3 comments

"GRANT EXECUTE ON FUNCTION upsert_grading_annotations(_plan_id uuid, _dzi_ids uuid[], _off TO service_role;"

I'm trying to get the schema from supabase so maybe this is a timeout issue.

Most of it is fine

--
-- Name: ensure_failed_has_error_message(); Type: PRIVILEGE; Schema: privileges; Owner: -
--

GRANT EXECUTE ON FUNCTION ensure_failed_has_error_message() TO anon;

Start to fail at same "col" implying there's a char limit

--
-- Name: upsert_grading_annotations(_plan_id uuid, _dzi_ids uuid[], _off; Type: PRIVILEGE; Schema: privileges; Owner: -
--

GRANT EXECUTE ON FUNCTION upsert_grading_annotations(_plan_id uuid, _dzi_ids uuid[], _off TO anon;

--
-- Name: upsert_grading_annotations(_plan_id uuid, _dzi_ids uuid[], _off; Type: PRIVILEGE; Schema: privileges; Owner: -
--

GRANT EXECUTE ON FUNCTION upsert_grading_annotations(_plan_id uuid, _dzi_ids uuid[], _off TO authenticated;


FFX3 avatar Jan 31 '26 00:01 FFX3

SELECT proname, pg_get_function_identity_arguments(oid) 
FROM pg_proc 
WHERE proname = 'upsert_grading_annotations';
proname pg_get_function_identity_arguments
upsert_grading_annotations _plan_id uuid, _dzi_ids uuid[], _offset_y integer, _offset_x integer

FFX3 avatar Jan 31 '26 00:01 FFX3

Could you please detail your sequence? Which pgschema command do you run?

tianzhou avatar Jan 31 '26 06:01 tianzhou

I hit the same issue in my environment. When the pgstattuple extension is installed, the dump outputs SQL like the following.

PostgreSQL 17.5 pgschema 1.6.2

GRANT EXECUTE ON FUNCTION pg_relpages(relname regclass) TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pg_relpages(relname text) TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstatginindex(relname regclass, OUT version integer, OUT pendi TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstathashindex(relname regclass, OUT version integer, OUT buck TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstatindex(relname regclass, OUT version integer, OUT tree_lev TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstatindex(relname text, OUT version integer, OUT tree_level i TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstattuple(relname text, OUT table_len bigint, OUT tuple_count TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstattuple(reloid regclass, OUT table_len bigint, OUT tuple_co TO pg_stat_scan_tables;
GRANT EXECUTE ON FUNCTION pgstattuple_approx(reloid regclass, OUT table_len bigint, OUT s TO pg_stat_scan_tables;

osapon avatar Feb 06 '26 10:02 osapon