Skip to content

Instantly share code, notes, and snippets.

@alexhwoods
Last active June 14, 2024 13:43
Show Gist options
  • Select an option

  • Save alexhwoods/4c4c90d83db3c47d9303cb734135130d to your computer and use it in GitHub Desktop.

Select an option

Save alexhwoods/4c4c90d83db3c47d9303cb734135130d to your computer and use it in GitHub Desktop.

Revisions

  1. alexhwoods revised this gist Feb 21, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Aiven doesn't allow you to have a superuser. Debezium tries to create a publicat

    # How To Fix It

    We have to create the publication before configuring the connector. Publications are database specific, so you have to do this when you're connected to the database you're going to use for CDC.
    We have to create the publication before configuring the connector. **Publications are database specific, so you have to do this when you're connected to the database you're going to use for CDC.**

    There is a package called [aiven-extras](https://github.com/aiven/aiven-extras) that allows you to create a publication.

  2. alexhwoods revised this gist Feb 21, 2020. 1 changed file with 12 additions and 5 deletions.
    17 changes: 12 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -6,21 +6,28 @@ You're getting this error: `Caused by: org.postgresql.util.PSQLException: ERROR:

    # Why This is Happening

    Aiven doesn't allow you to have a superuser. Debezium tries to create a publication, and fails, because it's not using a superuser.
    Aiven doesn't allow you to have a superuser. Debezium tries to create a publication, and fails, because it's not using a superuser.

    # How To Fix It

    We have to create the publication before configuring the connector. There is a package called [aiven-extras](https://github.com/aiven/aiven-extras) that allows you to create a publication.
    We have to create the publication before configuring the connector. Publications are database specific, so you have to do this when you're connected to the database you're going to use for CDC.

    1. Install aiven-extras
    There is a package called [aiven-extras](https://github.com/aiven/aiven-extras) that allows you to create a publication.

    1. Connect to the database you'll use.
    ```
    \connect foodb;
    ```

    2. Install aiven-extras
    ```
    CREATE EXTENSION aiven_extras CASCADE;
    ```

    2. Create a publication for all tables
    3. Create a publication for all tables
    ```sql
    SELECT *
    FROM aiven_extras.pg_create_publication_for_all_tables('dbz_publication', 'INSERT,UPDATE,DELETE')
    FROM aiven_extras.pg_create_publication_for_all_tables('dbz_publication', 'INSERT,UPDATE,DELETE');
    ```

    It must be called `dbz_publication`. That is what Debezium is expecting.
  3. alexhwoods revised this gist Jan 6, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ CREATE EXTENSION aiven_extras CASCADE;
    2. Create a publication for all tables
    ```sql
    SELECT *
    FROM aiven_extras.pg_create_publication_for_all_tables('dbz_publication', 'INSERT')
    FROM aiven_extras.pg_create_publication_for_all_tables('dbz_publication', 'INSERT,UPDATE,DELETE')
    ```

    It must be called `dbz_publication`. That is what Debezium is expecting.
  4. alexhwoods created this gist Jan 6, 2020.
    28 changes: 28 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    # Issue

    You're trying to use Kafka Connect, using the Debezium to Postgres, and your Postgres database is running on Aiven. You have `pgoutput` selected as the plugin name (this is the best choice).

    You're getting this error: `Caused by: org.postgresql.util.PSQLException: ERROR: must be superuser to create FOR ALL TABLES publication`.

    # Why This is Happening

    Aiven doesn't allow you to have a superuser. Debezium tries to create a publication, and fails, because it's not using a superuser.

    # How To Fix It

    We have to create the publication before configuring the connector. There is a package called [aiven-extras](https://github.com/aiven/aiven-extras) that allows you to create a publication.

    1. Install aiven-extras
    ```
    CREATE EXTENSION aiven_extras CASCADE;
    ```

    2. Create a publication for all tables
    ```sql
    SELECT *
    FROM aiven_extras.pg_create_publication_for_all_tables('dbz_publication', 'INSERT')
    ```

    It must be called `dbz_publication`. That is what Debezium is expecting.

    Now, you can run your connector and it should work (or you might have other, likely fixable issues).