Viewing Postgres errors (plpgsql already exists / array_accum function already exists) in the Rails app log

I keep seeing the following postgres errors / warnings in my Rails development log. It doesn't crash my application (hopefully). Any idea what might be causing them? What can I do to debug this?

Installed on 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

      

0


a source to share


2 answers


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



The rails are prepared for this and simply ignore these errors. Not a good example of programming, but nothing to worry about.

0


a source


I realized that this error was due to my error

  • lost test database
  • new test database created
  • While trying to migrate the development database structure to test the list item, tried the other way around.


Side effects of long working hours;)

0


a source







All Articles