Repository: supabase/cli

Issue #600: "function graphql.get_built_schema_version() does not exist" during supabase start
Created: 2022-11-13T05:51:20Z
Bug report
Describe the bug
Trying to follow the Github Actions CI/CD tutorial, when the runner gets to the "supabase start" step. It runs into an issue where graphql.get_built_schema_version() does not exist on the newly spun up database.
Related issues:

#583
#246
#477

Inspecting my older project, I can see that it has a get_built_schema_version() function, where as newly spun up projects both on the cloud and locally don't. I have a migration script committed by this older project which I'm assuming is leading to this failure.
Can I safely comment the following out from my "supabase db remote commit" generated migration script? Or are these functions supposed to be in the new db as well?
-- Name: FUNCTION "get_built_schema_version"(); Type: ACL; Schema: graphql; Owner: supabase_admin
--

GRANT ALL ON FUNCTION "graphql"."get_built_schema_version"() TO "postgres";
GRANT ALL ON FUNCTION "graphql"."get_built_schema_version"() TO "anon";
GRANT ALL ON FUNCTION "graphql"."get_built_schema_version"() TO "authenticated";
GRANT ALL ON FUNCTION "graphql"."get_built_schema_version"() TO "service_role";


--
-- Name: FUNCTION "rebuild_on_ddl"(); Type: ACL; Schema: graphql; Owner: supabase_admin
--

GRANT ALL ON FUNCTION "graphql"."rebuild_on_ddl"() TO "postgres";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_ddl"() TO "anon";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_ddl"() TO "authenticated";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_ddl"() TO "service_role";


--
-- Name: FUNCTION "rebuild_on_drop"(); Type: ACL; Schema: graphql; Owner: supabase_admin
--

GRANT ALL ON FUNCTION "graphql"."rebuild_on_drop"() TO "postgres";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_drop"() TO "anon";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_drop"() TO "authenticated";
GRANT ALL ON FUNCTION "graphql"."rebuild_on_drop"() TO "service_role";


--
-- Name: FUNCTION "rebuild_schema"(); Type: ACL; Schema: graphql; Owner: supabase_admin
--

GRANT ALL ON FUNCTION "graphql"."rebuild_schema"() TO "postgres";
GRANT ALL ON FUNCTION "graphql"."rebuild_schema"() TO "anon";
GRANT ALL ON FUNCTION "graphql"."rebuild_schema"() TO "authenticated";
GRANT ALL ON FUNCTION "graphql"."rebuild_schema"() TO "service_role";


--
-- Name: FUNCTION "variable_definitions_sort"("variable_definitions" "jsonb"); Type: ACL; Schema: graphql; Owner: supabase_admin
--

GRANT ALL ON FUNCTION "graphql"."variable_definitions_sort"("variable_definitions" "jsonb") TO "postgres";
GRANT ALL ON FUNCTION "graphql"."variable_definitions_sort"("variable_definitions" "jsonb") TO "anon";
GRANT ALL ON FUNCTION "graphql"."variable_definitions_sort"("variable_definitions" "jsonb") TO "authenticated";
GRANT ALL ON FUNCTION "graphql"."variable_definitions_sort"("variable_definitions" "jsonb") TO "service_role";

To Reproduce
Run the following in github actions

name: CI

on:
  pull_request:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./backend
    steps:
      - uses: actions/checkout@v3

      - uses: supabase/setup-cli@v1
        with:
          version: 1.12.2

      - name: Start Supabase local development setup
        run: supabase start```

## Expected behavior

The command to run sucessfully.

Duplicate issue #615: ERROR: schema graphql is not a member of extension "pg_graphql"
Created: 2022-11-16T19:57:23Z
Bug report
Describe the bug
I'm trying to generate typescript types for my project. I installed the latest supabase cli, logged in, linked the project and ran supabase db remote commit. After that I ran supabase db reset as was recommended by the cli. This caused the following error:
Error: ERROR: schema graphql is not a member of extension "pg_graphql" (SQLSTATE 55000)

To Reproduce
See above
Expected behavior
The initial migration works as expected, so that I can generate typescript types.
Screenshots
If applicable, add screenshots to help explain your problem.
System information

OS: macOS
Version of supabase-cli: [e.g. 1.14.0]

Additional context
I toggled the pg_graphql extension off and on again in the dashboard, but the issue still wasn't resolved.

Closing comment (2022-11-18T02:14:17Z): Thanks for reporting this issue. It is similar to #600 and #612. Our pg_dump script should ignore all schema changes generated by extensions. Unfortunately we haven't found a way to reliably exclude grants and revokes from pg_dump.
Our suggestion atm is to manually comment out lines containing ACL changes to graphql schema.