From 393908c752da2b8c05de0b48a6e83a15d6ef2c30 Mon Sep 17 00:00:00 2001 From: Merul Patel Date: Mon, 16 Mar 2009 18:05:47 +0000 Subject: [PATCH] Fixed connector for issues with TSearch2 and PostgreSQL 8.3 --- .../connection_adapters/postgresql_adapter.rb | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 913bb52..13213f1 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -610,11 +610,17 @@ module ActiveRecord # Returns the list of all tables in the schema search path or a specified schema. def tables(name = nil) schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',') - query(<<-SQL, name).map { |row| row[0] } + all_tables = query(<<-SQL, name).map { |row| row[0] } SELECT tablename FROM pg_tables WHERE schemaname IN (#{schemas}) SQL + excluded_tables = query(<<-SQL, name).map {|row| row[0] } + SELECT tablename + FROM pg_tables + WHERE schemaname IN ('pg_catalog') + SQL + all_tables - excluded_tables end # Returns the list of all indexes for a table. -- 1.6.0.5