From what I can tell CakePHP 3.x support claims support for PostgreSQL 8+ but in practice I found that out of the box there is a missing cast before PostgreSQL 8.3 for regclass::text. If you attempt a simple model in CakePHP 3 you will get an error similar to this
There was 1 error:
1) App\Test\TestCase\Model\Table\SampleListsTableTest::testFoo
Cake\Database\Exception: SQLSTATE[42846]: Cannot coerce: 7 ERROR: cannot cast type regclass to text
LINE 11: ... pg_get_serial_sequence(attr.attrelid::regclass::text, attr...
This is because the regclass::text cast does not exist until PostgreSQL 8.3. I checked this on multiple instances I have of PostgreSQL 8.2. The fix is rather easy but not immediately obvious.
DROP CAST IF EXISTS (regclass AS text);
CREATE OR REPLACE FUNCTION public.text(regclass) RETURNS text STRICT
STABLE AS '
SELECT pg_catalog.textin(pg_catalog.regclassout($1::regclass));'
LANGUAGE 'SQL';
CREATE CAST (regclass AS text) WITH FUNCTION public.text(regclass);
I'm not sure if this should be considered a bug in CakePHP 3.x or if it should be included as a caveat for older Postgres support in the install notes but either way if someone could confirm this behavior that would be great.