Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Unanswered: How can I get createlang / plpgsql to work in CentOS Linux?

    Hello
    I am running Linux CentOS 5.4 with a fresh install of PostgreSQL 8.4.

    I need to use plpgsql for stored procedures, however I can't get the createlang command to work, in order to turn plpgsql on for specific databases.

    I get 'command not found' for every call I tried:

    createlang
    createlang -U postgres plpgsql template1
    ./createlang -U postgres plpgsql template1
    sudo ./createlang -U postgres plpgsql template1

    On most forums I read that I need to add the folder containing plpgsql.so to my PATH. Everyone says this folder should be /usr/local/pgsql/bin, but in my case plgsql.so gets placed under /opt/PostgreSQL/8.4/lib/postgresql. (Could it be due to a newer version of postgres?).
    Anyway, I added both of these to my PATH and the createlang command is still not working. I've spent very many hours on this.

    If someone knows how to do this please let me know.

    Thank you.

    coder2010

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    I don't know about CentOS but typically it is in the path for the postgres user, so su to that user first.

  3. #3
    Join Date
    Jun 2010
    Posts
    17
    Please follow the below test case to create language for the particular database.


    Step 1: connect to the database

    edbs-MacBook-4:bin postgres$ ./psql -d postgres -p 5444
    Welcome to psql 8.3.10, the PostgreSQL interactive terminal.

    Type: \copyright for distribution terms
    \h for help with SQL commands
    \? for help with psql commands
    \g or terminate with semicolon to execute query
    \q to quit


    postgres=# select lanname from pg_language;
    lanname
    ----------
    internal
    c
    sql
    (3 rows)


    NOTE: Here plpgsql language doesn't exist

    Step 2: Create the language using "createlang" Binary

    edbs-MacBook-4:bin postgres$ ./createlang -d postgres -p 5444 -U postgres plpgsql postgres


    Step 3: Sanity Check

    edbs-MacBook-4:bin postgres$ ./psql -d postgres -p 5444Welcome to psql 8.3.10, the PostgreSQL interactive terminal.

    Type: \copyright for distribution terms
    \h for help with SQL commands
    \? for help with psql commands
    \g or terminate with semicolon to execute query
    \q to quit

    postgres=# select lanname from pg_language;
    lanname
    ----------
    internal
    c
    sql
    plpgsql
    (4 rows)


    Thanks & Regards
    Raghu Ram
    EnterpriseDB: The Enterprise Postgres Company - Open Source Database

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •