3 ms·
Did you mean "foos.foos = 'value'"? I do not get an error on the column not existing with "where foos = 'value'" (which is the query you wrote). However, it doe
by saurik 13y ago
Did you mean "foos.foos = 'value'"? I do not get an error on the column not existing with "where foos = 'value'" (which is the query you wrote). However, it does turn out I'm wrong on a key aspect: PostgreSQL refuses to convert untyped-text to a record without a cast "ERROR: input of anonymous composite types is not implemented" (which would make this require at least a tuple to have been passed into the query to begin with, which seems extremely unlikely, and likely require the cast, which wouldn't happen).
- icambron 13y agoSorry, yes, I meant "foos.foos='value'", which AR writes because the code generating it doesn't pay attention to what joins you've attached (or in this case, haven't) and what ambiguities that might create, so it does the safe thing. I also noticed the error you mentioned when playing with it, but didn't understand it well enough to be confident there was no way to force that cast.