Reputation: 5745
I am wondering if using a "?" in a field name will cause any problems when using Rails 5 and Postgres?
Example of field name:
want_to_sell?
has_certification?
Upvotes: 0
Views: 33
Reputation:
In SQL, a question mark ?
is invalid in an identifier. The only way you could use that is if you use the dreaded quoted identifiers.
create table bad_names
(
"want_to_sell?" boolean,
"has_certification?" boolean
);
But I strongly suggest you do not do that.
Quoted identifiers generate so many problems down the line that they are not worth the perceived little advantage of following the naming conventions from a different programming language.
Upvotes: 2