cweijan / vscode-database-client

Database Client For Visual Studio Code
https://database-client.com
MIT License
2.4k stars 266 forks source link

[BUG] No export on PostgreSQL Temporary Tables #1022

Open DasBen opened 6 months ago

DasBen commented 6 months ago

Was happy about the free version and just bought the premium package. Then i instantly found a bug 🤣

I'm creating multiple temporary tables with postgres and then joining them to export these as csv. This example has only one, but this is still reproducable:

DROP TABLE IF EXISTS network_params_aggr_numeric;

SELECT DISTINCT
    network,
    value as "numeric"
INTO TEMPORARY TABLE network_params_aggr_numeric
FROM network_params
WHERE 1=1
AND network  > 0 and network IN (SELECT code FROM networks)
AND param_type IN (3);

SELECT
     n.code AS "code",
     np.numeric AS "numeric"
FROM networks n
JOIN network_params_aggr_numeric np ON n.code = np.network
WHERE n.code > 0

Now we have two scenarios:

I guess the "Remove Pagination SQL" is opening a second session, so that the temporary tables are not available.

Of course I can create persistent tables and then just drop them, but that is what the temporary tables are for.

cweijan commented 6 months ago

Thanks for the feedback, a new connection will be used when performing the export, I will try to fix this.

cweijan commented 5 months ago

Fixed in version 6.9.10.

DasBen commented 5 months ago

I just retried with 6.9.10 and still get the same error:

2024-01-11 12:56:11 Cannot read properties of null (reading 'name')

Here a screenshot of the active version: image

cweijan commented 5 months ago

Thanks feedback, I will check it again.

DasBen commented 5 months ago

Thanks for trying to fix this so fast 👍 Keep up the good work.