persefon Posted April 23, 2011 Posted April 23, 2011 Hello, I have the same prooblem, I really need plpgsql to my functions. Thanks
Ashoat Posted April 23, 2011 Posted April 23, 2011 I'm seeing it as installed: postgres=# SELECT COUNT(*) FROM pg_language WHERE lanname = 'plpgsql'; count ------- 1 (1 row)
Guest Geoff Posted April 23, 2011 Posted April 23, 2011 Hello, I have the same prooblem, I really need plpgsql to my functions. Thanks Are you also on johnny?
Ashoat Posted April 25, 2011 Posted April 25, 2011 What query are you doing to check if the language is installed?
gotik Posted April 25, 2011 Author Posted April 25, 2011 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.
Ashoat Posted April 26, 2011 Posted April 26, 2011 Is it the case that you have to be a superuser to have access to plpgsql?
gotik Posted April 26, 2011 Author Posted April 26, 2011 It is not necessary, you can access to my schema and execute the command. My schema is gespro on database gespro_db.
gotik Posted April 27, 2011 Author Posted April 27, 2011 Yes! Thank you so much, sorry for the inconvenience
Ashoat Posted April 27, 2011 Posted April 27, 2011 persefon: If you need it too, let me know what database you want it configured on.
Recommended Posts