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

Parsing postgres queries #388

Open
ea-rus opened this issue Jul 26, 2024 · 1 comment
Open

Parsing postgres queries #388

ea-rus opened this issue Jul 26, 2024 · 1 comment

Comments

@ea-rus
Copy link
Contributor

ea-rus commented Jul 26, 2024

Add to support by parser:

  • match (~) or not match operators (!~)
  • order with column index
  • case <col> when <value> then <value> ...
    • at the moment supported is: case when <condition> then <value> ...

Example query:

SELECT n.nspname as "Schema",
  c.relname as "Name",
  CASE c.relkind WHEN 'r' THEN 'table'  WHEN 'I' THEN 'partitioned index' END as "Type",  -- <-------------
  pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
     LEFT JOIN pg_catalog.pg_am am ON am.oid = c.relam
WHERE c.relkind IN ('r','p','v','m','S','f','')
      AND n.nspname <> 'pg_catalog'
      AND n.nspname !~ '^pg_toast'           -- <-------------
      AND n.nspname <> 'information_schema'
  AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2   -- <-------------
@ea-rus
Copy link
Contributor Author

ea-rus commented Oct 31, 2024

Order with index is fixed in #400

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

No branches or pull requests

1 participant