If SQL::Abstract does not have a name_sep specified, it will attempt to quote the entire table-field name as "foo.id" and "bar.id" rather than "foo"."id" and "bar"."id", producing an error such as:
DBD::Pg::st execute failed: ERROR: column "foo.id" does not exist
LINE 1: SELECT "foo.id" FROM "foo", "bar" WHERE ( "foo.id" = "bar.id...
^ at lib/Test.pm line 50.
The workaround is to create the Mojo::Pg instance with:
However, since the name_sep and quote_char values are intrinsic to Postgres, it makes sense for these to be the setting on the default SQL::Abstract object.
When using SQL::Abstract with multiple tables, it is sometimes necessary to disambiguate columns:
If SQL::Abstract does not have a name_sep specified, it will attempt to quote the entire table-field name as
"foo.id"
and"bar.id"
rather than"foo"."id"
and"bar"."id"
, producing an error such as:The workaround is to create the Mojo::Pg instance with:
However, since the name_sep and quote_char values are intrinsic to Postgres, it makes sense for these to be the setting on the default SQL::Abstract object.