supabase / pgadmin4

Mirror of the pgAdmin 4 GIT repo. DO NOT submit pull requests here! Use the pgadmin-hackers@lists.postgresql.org mailing list. Issues should be logged at https://redmine.postgresql.org/projects/pgadmin4.
https://www.pgadmin.org
Other
12 stars 2 forks source link

Incorrect DDL order for event triggers #14

Open soedirgo opened 3 years ago

soedirgo commented 3 years ago

Bug report

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

  1. Create a directory named repro
  2. Create docker-compose.yml
    services:
    db1:
    image: supabase/postgres
    ports:
      - 5432:5432
    environment:
      POSTGRES_PASSWORD: postgres
    db2:
    image: supabase/postgres
    ports:
      - 5433:5432
    environment:
      POSTGRES_PASSWORD: postgres
  3. Run the following on db1:
    CREATE FUNCTION f() RETURNS event_trigger LANGUAGE plpgsql AS $$ BEGIN END; $$;
    CREATE EVENT TRIGGER et ON DDL_COMMAND_END
    WHEN TAG IN ('CREATE EXTENSION')
    EXECUTE PROCEDURE f();
  4. Run:
    docker run --rm -it --network repro_default supabase/pgadmin-schema-diff 'postgresql://postgres:postgres@db1/postgres' 'postgresql://postgres:postgres@db2/postgres'
  5. Run the resulting SQL on db2

Expected behavior

The SQL runs successfully.

soedirgo commented 3 years ago

This may have been fixed upstream, so I'd try resolving https://github.com/supabase/pgadmin4/issues/12 first.

soedirgo commented 2 years ago

12 doesn't nail it - similar problem to #25.