heroku-pg-extras
heroku-pg-extras copied to clipboard
Naming conventions
Cleaning up the README for the vacuum
PR, I noticed some inconsistencies in naming fields in the various queries we run, most notably referring to tables ('name', 'relname', 'table_name', 'table' are all used). Also, some queries include the schema; most omit it. It would be good to have some consistency here. How about the following:
- use 'table' to refer to table names
- omit schema if 'public', otherwise prepend it to the table name with a delimiter ('::' ?)
Jumping on this: We have one database which uses multiple schemas, each with identical table names, as a result it's impossible to uniquely identify tables in the output.
E.g. for pg:table-size
:
name | size
-------------------+------------
source_apple | 14 MB
source_apple | 14 MB
source_banana | 640 kB
source_banana | 600 kB
source_clementine | 96 kB
source_clementine | 88 kB
One option would be just to prepend n.nspname AS schema
to the select, but I don't know if that would be considered too spammy (since the average user is probably going to just see a column of public
).