{"action":"closed","issue":{"url":"https://api.github.com/repos/flyway/flyway/issues/1106","labels_url":"https://api.github.com/repos/flyway/flyway/issues/1106/labels{/name}","comments_url":"https://api.github.com/repos/flyway/flyway/issues/1106/comments","events_url":"https://api.github.com/repos/flyway/flyway/issues/1106/events","html_url":"https://github.com/flyway/flyway/issues/1106","id":111434798,"number":1106,"title":"A tableName \"\"\"t\"\"\" cause error on PostgreSQLSchema.doAllTables() ","user":{"login":"lisboa","id":802671,"avatar_url":"https://avatars.githubusercontent.com/u/802671?v=3","gravatar_id":"","url":"https://api.github.com/users/lisboa","html_url":"https://github.com/lisboa","followers_url":"https://api.github.com/users/lisboa/followers","following_url":"https://api.github.com/users/lisboa/following{/other_user}","gists_url":"https://api.github.com/users/lisboa/gists{/gist_id}","starred_url":"https://api.github.com/users/lisboa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisboa/subscriptions","organizations_url":"https://api.github.com/users/lisboa/orgs","repos_url":"https://api.github.com/users/lisboa/repos","events_url":"https://api.github.com/users/lisboa/events{/privacy}","received_events_url":"https://api.github.com/users/lisboa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flyway/flyway/labels/d:%20PostgreSQL","name":"d: PostgreSQL","color":"207de5"},{"url":"https://api.github.com/repos/flyway/flyway/labels/m:%20Core","name":"m: Core","color":"fad8c7"},{"url":"https://api.github.com/repos/flyway/flyway/labels/t:%20bug","name":"t: bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/flyway/flyway/milestones/7","html_url":"https://github.com/flyway/flyway/milestones/Flyway%204.0","labels_url":"https://api.github.com/repos/flyway/flyway/milestones/7/labels","id":791343,"number":7,"title":"Flyway 4.0","description":"","creator":{"login":"axelfontaine","id":684824,"avatar_url":"https://avatars.githubusercontent.com/u/684824?v=3","gravatar_id":"","url":"https://api.github.com/users/axelfontaine","html_url":"https://github.com/axelfontaine","followers_url":"https://api.github.com/users/axelfontaine/followers","following_url":"https://api.github.com/users/axelfontaine/following{/other_user}","gists_url":"https://api.github.com/users/axelfontaine/gists{/gist_id}","starred_url":"https://api.github.com/users/axelfontaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelfontaine/subscriptions","organizations_url":"https://api.github.com/users/axelfontaine/orgs","repos_url":"https://api.github.com/users/axelfontaine/repos","events_url":"https://api.github.com/users/axelfontaine/events{/privacy}","received_events_url":"https://api.github.com/users/axelfontaine/received_events","type":"User","site_admin":false},"open_issues":52,"closed_issues":29,"state":"open","created_at":"2014-09-16T09:39:32Z","updated_at":"2015-10-27T14:27:42Z","due_on":"2015-09-06T22:00:00Z","closed_at":null},"comments":0,"created_at":"2015-10-14T16:18:28Z","updated_at":"2015-10-27T14:27:42Z","closed_at":"2015-10-27T14:27:42Z","body":"The test PostgreSQLMigrationMediumTest.view(),  used to test quoted table names, fail when try to cleanup the schema. I using the PostgreSQL 9.4.4.\r\n\r\nThe cause of error is the query used to get all table names. See the line 268 of [PostgreSQLSchema](https://github.com/flyway/flyway/blob/master/flyway-core/src/main/java/org/flywaydb/core/internal/dbsupport/postgresql/PostgreSQLSchema.java):\r\n\r\n```\r\n   \"SELECT t.table_name FROM information_schema.tables t\" +\r\n    //in this schema\r\n   \" WHERE table_schema=?\" +\r\n   //that are real tables (as opposed to views)\r\n  \" AND table_type='BASE TABLE'\" +\r\n  //and are not child tables (= do not inherit from another table).\r\n  \" AND NOT (SELECT EXISTS (SELECT inhrelid FROM pg_catalog.pg_inherits\" +\r\n  \" WHERE inhrelid = ('\\\"'||t.table_schema||'\\\".\\\"'||t.table_name||'\\\"')::regclass::oid))\"  <== erro is here\r\n```\r\nInstead of\r\n\r\n```\r\n \" WHERE inhrelid = ('\\\"'||t.table_schema||'\\\".\\\"'||t.table_name||'\\\"')::regclass::oid))\"  <== erro is here \r\n```\r\nUsing the <b>quot_ident</b> function fix the problem, as showed bellow:\r\n\r\n```\r\n\" WHERE inhrelid = (quote_ident(t.table_schema)||'.'||quote_ident(t.table_name))::regclass::oid))\"\r\n```\r\n\r\nNote: Seem that the function <b>quot_ident</b> exists since PostgreSQL 7.3.\r\n\r\nThanks,\r\nFabio."}}