summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/management/commands/setup_postgresql_full_text_search.plsql14
1 files changed, 14 insertions, 0 deletions
diff --git a/askbot/management/commands/setup_postgresql_full_text_search.plsql b/askbot/management/commands/setup_postgresql_full_text_search.plsql
new file mode 100644
index 00000000..05d9bc37
--- /dev/null
+++ b/askbot/management/commands/setup_postgresql_full_text_search.plsql
@@ -0,0 +1,14 @@
+CREATE OR REPLACE FUNCTION column_exists(colname text, tablename text)
+RETURNS boolean AS
+$$
+DECLARE
+ q text;
+ onerow record;
+BEGIN
+q = `SELECT attname FROM pg_attribute WHERE attrelid = ( SELECT oid FROM pg_class WHERE relname = '''||tablename||''') AND attname = '''||colname||''' `;
+
+END
+$$
+LANGUAGE plpgsql
+
+CREATE OR REPLACE FUNCTION