Re: How to successfully create a new function?

From: Jim Moon <moonjamesg(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to successfully create a new function?
Date: 2012-03-30 15:17:19
Message-ID: CAMW+QwGGxwqkQnAfg33E0XodJJD-DDzwJQuaieMO+-ZmLnKZoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Andreas,

Thank you for your advice--query and other:

This query:

CREATE OR REPLACE FUNCTION "sp_SetScenario"(scen character varying) RETURNS
void AS

$BODY$DECLARE

sqlStatement varchar(500);

BEGIN

SET sqlStatement = 'ALTER USER postgres WITH DEFAULT_SCHEMA
= $1';

EXECUTE(sqlStatement);

END;

$BODY$

LANGUAGE 'pgpsql' VOLATILE

COST 100;

returns:

ERROR: language "pgpsql" does not exist

********** Error **********

ERROR: language "pgpsql" does not exist

SQL state: 42704

The only language options in the New Function “wizard” in pgAdmin III are:

internal

c

sql

I would be grateful for any further suggestions from you or others.

Kind regards,
Jim

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Alex Koay 2012-03-30 19:31:28 Using Table Indexes After Joins
Previous Message Thomas Kellerer 2012-03-30 11:56:35 Re: EXPLAIN explanation