Skip to content

Instantly share code, notes, and snippets.

@davidray
Created May 14, 2009 20:28
Show Gist options
  • Select an option

  • Save davidray/111883 to your computer and use it in GitHub Desktop.

Select an option

Save davidray/111883 to your computer and use it in GitHub Desktop.
-- execute("CREATE INDEX people_fts_vector_index ON people USING gist(vector);")
-> 0.0040s
-> 0 rows
-- execute("CREATE FUNCTION people_trigger() RETURNS trigger AS $$\n begin\n new.vector :=\n setweight(to_tsvector('pg_catalog.english', coalesce(new.first_name,'')), 'B') ||\n setweight(to_tsvector('pg_catalog.english', coalesce(new.last_name,'')), 'B') ||\n setweight(to_tsvector('pg_catalog.english', coalesce(new.first_name_soundex,'')), 'A') ||\n setweight(to_trake aborted!
ActiveRecord::ActiveRecordError: ERROR: language "plpgsql" does not exist: CREATE FUNCTION people_trigger() RETURNS trigger AS $$
begin
new.vector :=
setweight(to_tsvector('pg_catalog.english', coalesce(new.first_name,'')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(new.last_name,'')), 'B') ||
setweight(to_tsvector('pg_catalog.english', coalesce(new.first_name_soundex,'')), 'A') ||
setweight(to_tsvector('pg_catalog.english', coalesce(new.last_name_soundex,'')), 'A');
return new;
end
$$ LANGUAGE plpgsql;
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/david/opt/jruby/bin/jruby -S rake db...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment