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

Use '%s' as format() placeholder for regclass items #18

Closed
mreithub opened this issue May 10, 2016 · 0 comments
Closed

Use '%s' as format() placeholder for regclass items #18

mreithub opened this issue May 10, 2016 · 0 comments
Milestone

Comments

@mreithub
Copy link
Owner

Right now, I'm using %I.%I for table names in dynamic queries (EXECUTE format(...)). But PostgreSQL's regclass to string casts are safe, i.e. they automatically escape spaces and other unsafe characters. Therefore format()'s %s placeholder can be used.

The advantage of this (other than its readability) is that we won't need to resolve the schema and table names ourselves every single time.

@mreithub mreithub added this to the 1.0 milestone May 10, 2016
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