language "plpgsql" does not exist

Поиск
Список
Период
Сортировка
От Keith Worthington
Тема language "plpgsql" does not exist
Дата
Msg-id 20041216230204.M24736@narrowpathinc.com
обсуждение исходный текст
Ответы Re: language "plpgsql" does not exist  (Terry Lee Tucker <terry@esc1.com>)
Re: language "plpgsql" does not exist  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
Hi All,

I am trying to build a function to insert or update data in one table from
date stored in another table.  Eventually I hope to trigger this process based
on data being INSERTed into the original table.  I have written the code below
based on the documentation and some help from this list.  When I execute the
code I get this error.

ERROR:  language "plpgsql" does not exist

What does this mean?  How do I correct the error?

Kind Regards,
Keith

PS This is PostgreSQL v7.3.6 on Red Hat Enterprise Linux v3

CREATE FUNCTION xfer_gl_account_data() RETURNS INTEGER AS '
   DECLARE
      rcrd_gl_account RECORD;
   BEGIN
      FOR rcrd_gl_account IN SELECT
data_transfer.tbl_peachtree_gl_acount.account_id,

data_transfer.tbl_peachtree_gl_acount.description,

data_transfer.tbl_peachtree_gl_acount.account_type,
                                    data_transfer.tbl_peachtree_gl_acount.inactive
                               FROM data_transfer.tbl_peachtree_gl_acount
                              ORDER BY gl_number
      LOOP
         SELECT peachtree.tbl_gl_account.account_id
           FROM peachtree.tbl_gl_account
          WHERE peachtree.tbl_gl_account.account_id = rcrd_gl_account.account_id;
         IF NOT FOUND THEN
            INSERT INTO peachtree.tbl_gl_account
                        ( peachtree.tbl_gl_account.account_id,
                          peachtree.tbl_gl_account.description,
                          peachtree.tbl_gl_account.account_type,
                          peachtree.tbl_gl_account.inactive )
                 VALUES ( rcrd_gl_account.account_id,
                          rcrd_gl_account.description,
                          rcrd_gl_account.account_type,
                          rcrd_gl_account.inactive );
         ELSE
            UPDATE peachtree.tbl_gl_account
               SET peachtree.tbl_gl_account.description =
rcrd_gl_account.description,
                   peachtree.tbl_gl_account.account_type =
rcrd_gl_account.account_type,
                   peachtree.tbl_gl_account.inactive = rcrd_gl_account.inactive
             WHERE peachtree.tbl_gl_account.account_id =
rcrd_gl_account.account_id;
         END IF;
      END LOOP;
      RETURN 1;
   END;
' LANGUAGE 'plpgsql';


______________________________________________
99main Internet Services http://www.99main.com


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Luiz K. Matsumura"
Дата:
Сообщение: Re: basic download and setup questions
Следующее
От: Afton & Ray Still
Дата:
Сообщение: Re: basic download and setup questions