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

Add option to show tables from all PgSQL schemas #2027

Open
jrjsmrtn opened this issue Sep 13, 2023 · 4 comments
Open

Add option to show tables from all PgSQL schemas #2027

jrjsmrtn opened this issue Sep 13, 2023 · 4 comments

Comments

@jrjsmrtn
Copy link

I usually use multiple schemas in PostgreSQL databases. Unfortunately, vd/vdsql only shows public.* tables.

An option to configure table visibility would be nice :-)

  • by default: show public tables;
  • show all tables, except system tables (pg_catalog, information_schema);
  • show system tables (pg_catalog, information_schema).

(I don't know Visidata internals... yet. If you can give me some pointers on how to implement this, I may have a look ;-)

@saulpw
Copy link
Owner

saulpw commented Sep 14, 2023

Hey @jrjsmrtn, thanks for the request. vdsql uses Ibis under the hood. If you can get some Ibis code to do what you want with their Postgres backend, then we should be able to get it working with vdsql pretty easily. I think this would be really useful!

@CharlesARoy
Copy link

CharlesARoy commented Oct 5, 2023

I spent a bunch of time yesterday trying to figure out why vd/vdsql weren't showing any rows when I'd connect to a Postgresql database. In the end, it seems to have been because none of the schemas were public. After running the SQL commands described in this thread to make the schemas public, I was finally able to view the database.

Edit: Today I found this issue which provides an actual fix for this situation. I just needed to add --postgres-schema=foo to load tables with schema foo. This option is documented in the man, I just hadn't realized that I needed it...

@saulpw
Copy link
Owner

saulpw commented Oct 5, 2023

@CharlesARoy Glad you were able to figure it out! @jrjsmrtn's PR might also help with this when it gets merged, as it should load tables from all schemas by default. Maybe you'd be able to test PR #2028 with the database you had with the private schemas?

@Mickychen00
Copy link

Hi. Is there any new progress here? I encountered an error: "no matches found: --postgres-schema=**"
vdsql --version
saul.pw/VisiData v3.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants