Open emil14 opened 4 years ago
Another problem related to this is when I click "Generate insert query" it generates query with duplicates
INSERT INTO some_table (
service_id,
service_id,
)
VALUES (
'service_id:uuid',
'service_id:uuid',
);
@emil14 which driver are you using?
@mtxr I'm using "SQLTools PostgreSQL/Redshift Driver"
I'm not able to reproduce this.
Are you using extension and latest versions?
Tested on PostgreSQL 12.2 (Debian 12.2-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
@mtxr I'm using the same versions of "SQLTools" and "PostgreSQL/Redshift Driver" on Ubuntu 18.04.5 LTS
Here's what I have :)
Hey there! Any progress?
create table if not exists users (
id serial primary key,
tg_chat_id integer unique check (tg_chat_id > 0)
);
create table if not exists assets (
id serial primary key,
name varchar(255) not null unique
);
create table if not exists accounts (
id serial primary key,
user_id integer references users(id),
name varchar(255) not null,
asset_id integer references assets(id),
unique(user_id, name)
);
create table if not exists users_accounts (
id serial primary key,
user_id integer references users(id),
account_id integer references accounts(id),
unique(user_id, account_id)
);
I could fix this by myself but have no idea how this work. I know fullstack web dev thought. We can have zoom call and fix it together :)
:(
Potentially related on Stack Overflow: VSCode extension "SQL Tools" showing duplicate attributes in mysql database
@emil14 The error is most likely in the query that gets a list of columns for the side panel: https://github.com/mtxr/vscode-sqltools/blob/dev/packages/driver.pg/src/ls/queries.ts. Check fetchColumns query. Can you run that query on databases where you see duplicate columns?
I reckon it's because the join condition isn't restrictive enough. I don't know enough about postgres to comment on what exactly but I'd start the investigation from there. I'll try to reproduce it this weekend hopefully
Hello! And thank you for great extension!
It would be great if we could see columns without duplicate rows. What I mean:
To me it looks like a made mistake in SQL or something. Would be great to see a single row for a single column
Thanks! :)