2

I installed Etherpad lite and tried to use it with PostgreSQL database, but got this error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
error: language "plpgsql" does not exist
    at Connection.parseE (/opt/openerp/etherpad/etherpad-lite/src/node_modules/$
    at Connection.parseMessage (/opt/openerp/etherpad/etherpad-lite/src/node_mo$
    at Socket.<anonymous> (/opt/openerp/etherpad/etherpad-lite/src/node_modules$
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:746:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Socket.Readable.push (_stream_readable.js:127:10)
RESTART!

In other servers I didn't have such problem using PostgreSQL with Etherpad. I created database using this command:

crate database etherpad WITH TEMPLATE template0;

My configuration in etherpad is like this:

"dbType" : "postgres",
   "dbSettings" : {
                    "user"    : "db_user",
                    "host"    : "localhost",
                    "password": "my_password",
                    "database": "etherpad"
                  },

Everything else is left unchanged, except I commented dirty db settings. P.S. with dirty db it works.

Andrius
  • 19,658
  • 37
  • 143
  • 243
  • 2
    (1) What version of PostgreSQL? (2) Why did you use template0 and not template1 as your db template? (3) Do you have the plpgsql language in database "etherpad" or "template0"? (4) Is it in "template1"? (5) Do you still have a question after finding out all these things? – Richard Huxton Oct 15 '13 at 09:14
  • Thanks. for some reason that language did not exist in database, so I had to create it manually (even using template1). So I think in PosgreSQL 8.4, it does not create by default as in newer versions? – Andrius Oct 15 '13 at 10:29
  • Indeed not. If you're committed to using old versions of software, you're going to have to allow some time to read through the manuals. Oh - support for PG v8.4 ends next July: http://www.postgresql.org/support/versioning/ – Richard Huxton Oct 15 '13 at 11:25

1 Answers1

3

If you are using 9.1 and below, you should CREATE LANGUAGE plpgsql in template1, and then create your database based on that template. This should not happen or be required on PostgreSQL 9.2 and above.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182