question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incremental snapshot sql fails on postgres 9.6 on dbt >= 0.17.0

See original GitHub issue

Describe the bug

Incremental snapshots do not work on Postgres 9.6

Steps To Reproduce

Create a snapshot using DBT when using a Postgres 9.6 database, and then attempt an incremental snapshot (i.e. run dbt snapshot twice) Error received of

failed to find conversion function from unknown to text

This is a regression of https://github.com/fishtown-analytics/dbt/issues/1665 Another user has identified on the slack that this was caused by https://github.com/fishtown-analytics/dbt/pull/2390 due to the union using non-casted fields introducing the issue in dbt 0.17.0

Expected behavior

DBT incremental snapshots should not throw an error on Postgres 9.6

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

Affects dbt >= 0.17.0

Additional context

Whilst I appreciate that this is for a unsupported “legacy” version of Postgres, I hope to be able to personally contribute to introduce to the Postgres plugin the equivalent fix as was introduced in https://github.com/fishtown-analytics/dbt/issues/1665 which should extend the life/support of dbt on 9.6 until it’s designated EoL of Nov 2021

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAkroydcommented, Feb 10, 2021

@jtcohen6 Thanks! Yes, as far as I can tell, it simply just requires the updating of these three lines which are causing the issue. Creating the dispatched adapter macro for string literal sounds like a very sensible approach - I was trying to think of ways which didn’t involve changing large amounts of code, and I think this is the most elegant way

I need to confirm if I can find time to set up the environment/sign contributors form etc, and then I should hopefully be able to a) test that this approach fixes the issue and b) contribute it in a PR

Thanks for your help!

0reactions
github-actions[bot]commented, Mar 28, 2022

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incremental snapshot sql fails on postgres 9.6 on dbt >= 0.17.0
Describe the bug Incremental snapshots do not work on Postgres 9.6 Steps To Reproduce Create a snapshot using DBT when using a Postgres...
Read more >
PostgreSQL 9.6.24 Documentation
This documentation is for an unsupported version of PostgreSQL. You may want to view the same page for the current version, or one...
Read more >
dbt Changelog - pyup.io
Raise better error if snapshot is missing required configurations ... Fix for incremental merge query on old versions of postgres (<=9.6) ...
Read more >
Debezium connector for PostgreSQL
If the primary server fails or is demoted, the connector stops. ... Incremental snapshots rely on the Debezium mechanism for sending signals to...
Read more >
dbt-core: Versions - Openbase
Full version history for dbt-core including change logs. ... Support the renaming of SQL to code happening in dbt-core (dbt-docs/#299, dbt-docs/#292) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found