Wt::Dbo - selecting fields with "from" in the name causes the SELECT statement to be misparsed
Postgres supports fields that include reserved words, like 'from':
SELECT from_field,to_field FROM test_table
However, queries like this result in a "not enough aliases for results" error in Wt::Dbo, as in:
session.query<boost::tuple<std::string,std::string>>("SELECT from_field,to_field FROM test_table")
Renaming the field fixes the problem. Also, just requesting that field by itself is fine (the following works):
session.query<boost::tuple<std::string>>("SELECT from_field FROM test_table")
I'm not sure what's happening here, but I assume the SQL parser is sometimes terminating the SELECT clause as soon as it sees the first "from", without looking ahead to see if it's followed by a space or not.