Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot add tables with CamelCase #28

Open
brentrjones opened this issue Mar 22, 2017 · 2 comments
Open

Cannot add tables with CamelCase #28

brentrjones opened this issue Mar 22, 2017 · 2 comments

Comments

@brentrjones
Copy link

Have some tables named with mixed-case (was there before I inherited).
I saw the other ticket about tables in all uppercase, but looks like mixed case may mix it up also

$ SELECT audit.audit_table('Account');
ERROR: 42P01: relation "account" does not exist
LINE 1: SELECT audit.audit_table('Account');
^
LOCATION: RangeVarGetRelidExtended, namespace.c:420

@dadambickford
Copy link

+1

@michaelfiber
Copy link

michaelfiber commented Oct 30, 2018

I was testing this script earlier with a table that has foldable characters and it looks like the use of quote_ident on a regclass parameter might be the issue. If all the quote_ident(table_name::TEXT) in the function are turned into simply table_name it works.

The documentation says that regclass will "do the right thing" with what it is given and it will give you a correct table name or throw an error if what it's given can't be found as a table.

I didn't do a pull request for it though because this is new to me and I don't know if there are any risks in accepting the value of a regclass. It looks like just using regclass is the right thing to do accordingg to documentation, but it's something I've never used in a project before so I'm not certain.

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

No branches or pull requests

3 participants