postgres_scanner
postgres_scanner copied to clipboard
duckdb.duckdb.BinderException: Binder Error: table gto_skc_store_step_kpi_summary has 213 columns but 184 values were supplied
I am performing calculations in DuckDB and then writing the results back to Greenplum. Since the rows are dynamic and the number of columns changes daily, I need to rebuild the table. The “CREATE TABLE AS” statement in DuckDB does not allow for the addition of distribution keys and compression settings, so I first use the postgres_execute function to create the table and then write the data. However, at this point, I receive an error indicating that the number of columns is different. This is likely because, when attaching, the table structure from Greenplum (i.e., yesterday’s structure) is obtained. How can I access the table that was just created so that I can reattach to it? Or are there any other suggestions?