Jump to content

gotik

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by gotik

  1. Hi djbob,

     

    SELECT COUNT(*) FROM pg_language WHERE lanname = 'plpgsql';

     

    count

    0

     

    and I try to create a function

     

    CREATE OR REPLACE FUNCTION dologin(IN i_user varchar, IN i_password varchar, OUT o_group integer) RETURNS INTEGER AS

    $$

    DECLARE

    BEGIN

    SELECT group_id INTO o_group FROM users WHERE nick=i_user AND password=i_password;

    IF NOT FOUND THEN

    SELECT 0 INTO o_group;

    END IF;

     

    RETURN;

    END;

    $$ LANGUAGE plpgsql;

     

    Because the plgpsql is not loaded by default I should to be loaded at the schema you want.

     

    I try on a Centos Virtual Machine and loaded the plpsql as postgres and other user wiht other schema cant access it.

     

    Thanks for your time djbob.

     

  2. Good Night,

     

    I created my functions in postgresql, but these functions need language plpgsql

     

    ERROR: language "plpgsql" does not exist

    HINT: Use CREATE LANGUAGE to load the language into the database.

     

    It's possible to create the language?.

     

    Thanks for your time.

     

     

×
×
  • Create New...