Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[destination-postgres] airbyte_safe_cast function already exists #39364

Closed
1 task done
lluiserena opened this issue Jun 10, 2024 · 3 comments
Closed
1 task done

[destination-postgres] airbyte_safe_cast function already exists #39364

lluiserena opened this issue Jun 10, 2024 · 3 comments
Labels
area/connectors Connector related issues community connectors/destination/postgres team/destinations Destinations team's backlog type/bug Something isn't working

Comments

@lluiserena
Copy link

lluiserena commented Jun 10, 2024

Connector Name

destination-postgres

Connector Version

2.0.10

What step the error happened?

During the sync

Relevant information

We believe we found a bug with PostgreSQL as a destination. We can consistently reproduce and think we have a fix.
https://github.com/airbytehq/airbyte/blob/3b3392317f166fecb8723531054c0c745865142b[…]byte/integrations/destination/postgres/PostgresDestination.java
Is not working as the comment states, for some reason, the connection is now kept consistent, and since that code runs multiple times in the same session, it always tries to create the existing function and fails

The could should check if the function exists before trying to create it

Relevant log output

`Stack Trace: org.postgresql.util.PSQLException: ERROR: function "airbyte_safe_cast" already exists with same argument types
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:335)
        at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:321)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:297)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:292)
        at com.zaxxer.hikari.pool.PoolBase.executeSql(PoolBase.java:579)
        at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:426)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461)
        at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:724)
        at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:703)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)`

Contribute

  • Yes, I want to contribute
@marcosmarxm
Copy link
Member

@lluiserena you're reporting a problem for source but referencing Destination Postgres, please update your issue to inform correclty which connector this is affecting.

@marcosmarxm marcosmarxm changed the title airbyte_safe_cast already exists [destination-postgres] airbyte_safe_cast already exists Jun 10, 2024
@marcosmarxm marcosmarxm changed the title [destination-postgres] airbyte_safe_cast already exists [destination-postgres] airbyte_safe_cast function already exists Jun 10, 2024
@d-shames
Copy link

fwiw my team is experiencing the same issue

@marcosmarxm
Copy link
Member

Solved by #39372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues community connectors/destination/postgres team/destinations Destinations team's backlog type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants