supabase db schema declarative generate --local --experimental --schema pgmq,public,<all my schemas>
supabase db schema declarative sync --experimental --schema pgmq,public,<all my schemas>
failed to parse pg-delta apply output: json: cannot unmarshal object into Go struct field ApplyResult.stuckStatements of type string stdout: {"status":"stuck","totalStatements":15,"totalRounds":2,"totalApplied":10,"totalSkipped":0,"errors":[],"stuckStatements":[{"statement":{"id":"cluster/extensions/pgmq.sql:0","sql":"CREATE EXTENSION pgmq WITH SCHEMA pgmq;","statementClass":"CREATE_EXTENSION"},"code":"3F000","message":"schema \"pgmq\" does not exist","isDependencyError":true},{"statement":{"id":"schemas/public/functions/pgmq_read.sql:0","sql":"CREATE FUNCTION public.pgmq_read (\n queue_name text,\n sleep_seconds integer DEFAULT 0,\n n integer DEFAULT 1\n)\n RETURNS SETOF pgmq.message_record\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO 'pgmq'\n AS $function$\nBEGIN\n -- Validate input parameters\n IF queue_name IS NULL OR queue_name = '' THEN\n RAISE EXCEPTION 'queue_name cannot be null or empty';\n END IF;\n \n IF sleep_seconds IS NULL OR sleep_seconds < 0 THEN\n RAISE EXCEPTION 'sleep_seconds must be non-negative, got: %', sleep_seconds;\n END IF;\n \n IF n IS NULL OR n <= 0 THEN\n RAISE EXCEPTION 'n must be a positive integer, got: %', n;\n END IF;\n \n RETURN QUERY\n SELECT * FROM pgmq.read(queue_name, sleep_seconds, n);\nEND;\n$function$;","statementClass":"CREATE_FUNCTION"},"code":"3F000","message":"schema \"pgmq\" does not exist","isDependencyError":true},{"statement":{"id":"schemas/public/functions/pgmq_read.sql:1","sql":"GRANT ALL ON FUNCTION public.pgmq_read(text, integer, integer) TO anon;","statementClass":"GRANT"},"code":"42883","message":"function public.pgmq_read(text, integer, integer) does not exist","isDependencyError":true},{"statement":{"id":"schemas/public/functions/pgmq_read.sql:2","sql":"GRANT ALL ON FUNCTION public.pgmq_read(text, integer, integer) TO authenticated;","statementClass":"GRANT"},"code":"42883","message":"function public.pgmq_read(text, integer, integer) does not exist","isDependencyError":true},{"statement":{"id":"schemas/public/functions/pgmq_read.sql:3","sql":"GRANT ALL ON FUNCTION public.pgmq_read(text, integer, integer) TO service_role;","statementClass":"GRANT"},"code":"42883","message":"function public.pgmq_read(text, integer, integer) does not exist","isDependencyError":true}]}
Describe the bug
There seems to be an issue with the experimental
declarativecommandTo Reproduce
Steps to reproduce the behavior:
generatecommand still succeeds in generating the files thoughsynccommand, and observe error about any function that refers topgmqschema not existingCommands:
Expected behavior
I would expect the
pgmqschema to be created in the shadow DB, because thecluster/extensions/pgmq.sqldoes contain pgmq enabling.Screenshots
Here's the output of
errors.txt:System information
Rerun the failing command with
--create-ticketflag.Additional context
I have included the generated
supabase/databasefolder as a ZIP, but I removed all schema's that I own. But the error happens insupabase/database/public/functions/pgmq_read.sqlanyway.database.zip