views:

822

answers:

1

I am constantly seeing the following postgres errors/warnings in my Rails development log. It's not causing my app to fail (I hope). Any idea what could be causing them? What can I do to debug this?

Installed in my PC: - Ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
- Rails 2.2.2
- PostgreSQL 8.3.7

  [4;36;1mSQL (0.1ms)[0m   [0;1mSET client_min_messages TO 'panic'[0m
  [4;35;1mSQL (0.1ms)[0m   [0mSET client_min_messages TO 'notice'[0m
  [4;36;1mSQL (0.7ms)[0m   [0;1mSELECT version FROM schema_migrations[0m
DEPRECATION WARNING: ActionMailer::Base.register_template_extension has been deprecated.Use ActionView::Base.register_template_extension instead. (called from /home/gsmendoza/workspace/idea/georgemendoza/config/environment.rb:104)
  [4;35;1mSQL (0.2ms)[0m   [0mbegin[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1msavepoint ts[0m
  [4;35;1mSQL (0.0ms)[0m   [0mPGError: ERROR: function "array_accum" already exists with same argument types
: CREATE AGGREGATE array_accum (anyelement)
 (
 sfunc = array_append,
 stype = anyarray,
 initcond = '{}'
 );
[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1mrollback to savepoint ts[0m
  [4;35;1mSQL (0.1ms)[0m   [0mrelease savepoint ts[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1mcommit[0m
  [4;35;1mSQL (0.1ms)[0m   [0mbegin[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1msavepoint ts[0m
  [4;35;1mSQL (0.0ms)[0m   [0mPGError: ERROR: language "plpgsql" already exists
: CREATE LANGUAGE 'plpgsql';[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1mrollback to savepoint ts[0m
  [4;35;1mSQL (0.1ms)[0m   [0mrelease savepoint ts[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1mcommit[0m
  [4;35;1mSQL (0.1ms)[0m   [0mbegin[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1msavepoint ts[0m
  [4;35;1mSQL (2.6ms)[0m   [0m CREATE OR REPLACE FUNCTION crc32(word text)
 RETURNS bigint AS $$
 DECLARE tmp bigint;
 DECLARE i int;
 DECLARE j int;
 DECLARE word_array bytea;
 BEGIN
 i = 0;
 tmp = 4294967295;
 word_array = decode(replace(word, E'\\', E'\\\\'), 'escape');
 LOOP
 tmp = (tmp # get_byte(word_array, i))::bigint;
 i = i + 1;
 j = 0;
 LOOP
 tmp = ((tmp >> 1) # (3988292384 * (tmp & 1)))::bigint;
 j = j + 1;
 IF j >= 8 THEN
 EXIT;
 END IF;
 END LOOP;
 IF i >= char_length(word) THEN
 EXIT;
 END IF;
 END LOOP;
 return (tmp # 4294967295);
 END
 $$ IMMUTABLE STRICT LANGUAGE plpgsql;
[0m
  [4;36;1mSQL (0.1ms)[0m   [0;1mrelease savepoint ts[0m
  [4;35;1mSQL (0.8ms)[0m   [0mcommit[0m
A: 

You don't need to do anything. It looks like Rails are just trying to install a plpgsql language, which is already installed, and create a function, that your version of PostgreSQL already has.

Rails are prepared for this and just ignore this errors. Not a good programming example but nothing to worry about.

Tometzky