Error in installing PDK 13.02

Viewpoint

Error in installing PDK 13.02

I am installing the PDK 13.02, and follow exactly the steps instructed in
http://developer.teradata.com/viewpoint/reference/getting-started-with-viewpoint-pdk/installing-the-...

I am using PDK 13.02, JDK 1.5, Ant 1.7.1, PostgreSQL 8.4

However, I got errors when running setup.bat (step 5) as follows. Any hint ?

C:\tdpdk-13.02.00.03\viewpoint-portal\setup\bin>setup.bat
Setting up Viewpoint databases.
Updating lportal schema.
Lportal schema updated.
Creating tdportal schema.
Setup of tdportal schema failed: StatementCallback; bad SQL grammar [CREATE OR R
EPLACE FUNCTION filteredPreferences(IN key_name_p VARCHAR(256), IN instance_p VA
RCHAR(256), IN portlet_p VARCHAR(256),
IN username_p VARCHAR(256), IN application_group_p VARCHAR(256)) RETURNS SETOF p
references AS '
BEGIN

BEGIN
CREATE TEMP TABLE my_preferences ( LIKE preferences );
EXCEPTION WHEN duplicate_table THEN
TRUNCATE my_preferences;
END;

BEGIN
CREATE TEMP TABLE my_roles ( LIKE role );
EXCEPTION WHEN duplicate_table THEN
TRUNCATE my_roles;
END;

DECLARE
role RECORD;
preference RECORD;
BEGIN

/* if no role specified in filter, then look up the user''s roles in t
he database */
IF application_group_p IS NULL AND username_p IS NOT NULL THEN
INSERT INTO my_roles (name)
SELECT fkRoleName from user_role_mapping where user_role_mapping.f
kUsername = username_p;
END IF;
/* if role is specified, then use only that role */
IF application_group_p IS NOT NULL THEN
INSERT INTO my_roles (name) VALUES (application_group_p)
;
END IF;

/* fill the temp table in precedence order (instance, portlet, user, r
ole) */
IF instance_p IS NOT NULL THEN
INSERT INTO my_preferences
SELECT * FROM preferences p
WHERE p.instance = instance_p
AND value_type != ''ENABLED''
AND p.portlet = portlet_p
AND p.key_name LIKE key_name_p;
END IF;

IF username_p IS NOT NULL THEN
INSERT INTO my_preferences
SELECT * FROM preferences p
WHERE p.username = username_p
AND value_type != ''ENABLED''
AND p.instance IS NULL
AND p.portlet = portlet_p
AND p.key_name LIKE key_name_p
AND p.key_name NOT IN
(SELECT key_name FROM my_preferences);
END IF;

IF application_group_p IS NOT NULL THEN
INSERT INTO my_preferences
SELECT * FROM preferences
WHERE (preferences.application_group = application_group_p)
AND value_type != ''ENABLED''
AND (preferences.instance IS NULL)
AND (preferences.username IS NULL)
AND preferences.key_name LIKE key_name_p
AND preferences.key_name NOT IN
(SELECT key_name FROM my_preferences);
ELSE

FOR role IN SELECT fkRoleName from user_role_mapping where user_role
_mapping.fkUsername = username_p
ORDER BY precedence ASC LOOP
INSERT INTO my_preferences
SELECT * FROM preferences
WHERE (preferences.application_group = role.fkRoleName)
AND value_type != ''ENABLED''
AND (preferences.instance IS NULL)
AND (preferences.username IS NULL)
AND preferences.portlet = portlet_p
AND preferences.key_name LIKE key_name_p
AND preferences.key_name NOT IN
(SELECT key_name FROM my_preferences);
END LOOP;
END IF;

IF portlet_p IS NOT NULL THEN
INSERT INTO my_preferences
SELECT * FROM preferences p
WHERE p.portlet = portlet_p
AND value_type != ''ENABLED''
AND p.instance IS NULL
AND p.username IS NULL
AND p.application_group IS NULL
AND p.key_name LIKE key_name_p
AND p.key_name NOT IN
(SELECT key_name FROM my_preferences);
END IF;

/* get the default values for anything we haven''t matched so far */
INSERT INTO my_preferences
SELECT * FROM preferences
WHERE preferences.key_name LIKE key_name_p
AND (value_type != ''ENABLED'')
AND (preferences.instance IS NULL)
AND (preferences.portlet IS NULL)
AND (preferences.username IS NULL)
AND (preferences.application_group IS NULL)
AND preferences.key_name NOT IN
(SELECT key_name FROM my_preferences);

/* special handling for ENABLED preferences */
FOR preference IN SELECT key_name, CAST(MIN(CAST(str_value AS INTEGER)
) AS VARCHAR) AS str_value
FROM preferences
WHERE (value_type = ''ENABLED'')
AND (preferences.instance = instance_p OR preference
s.instance IS NULL)
AND (preferences.portlet = portlet_p OR preferences.
portlet IS NULL)
AND (preferences.username = username_p OR preference
s.username IS NULL)
AND preferences.key_name LIKE key_name_p
AND ((preferences.application_group IS NULL) OR
(preferences.application_group IN
(SELECT name FROM my_roles)))
GROUP BY key_name LOOP
INSERT INTO my_preferences SELECT *
FROM preferences
WHERE (value_type = ''ENABLED'')
AND (preferences.instance = instance_p OR preference
s.instance IS NULL)
AND (preferences.portlet = portlet_p OR preferences.
portlet IS NULL)
AND (preferences.username = username_p OR preference
s.username IS NULL)
AND preferences.key_name LIKE preference.key_name
AND preferences.str_value LIKE preference.str_value
AND ((preferences.application_group IS NULL) OR
(preferences.application_group IN
(SELECT name FROM my_roles))) LIMIT 1
;
END LOOP;

FOR preference IN SELECT * FROM my_preferences LOOP
RETURN NEXT preference;
END LOOP;

RETURN;

END;

END;
' LANGUAGE plpgsql ]; nested exception is org.postgresql.util.PSQLException: FEH
LER: Sprache ?plpgsql? existiert nicht
Setup of Viewpoint database failed. Reverting changes.

C:\tdpdk-13.02.00.03\viewpoint-portal\setup>
4 REPLIES
dfu
Teradata Employee

Re: Error in installing PDK 13.02

Make sure you have performed Step 2.2 correctly of the setup guide.

Re: Error in installing PDK 13.02

I already done step 2.2 and got the information that "Language »plpgsql« is already installed in »template1« database"

Re: Error in installing PDK 13.02

I used PostgreSQL 8.2 and everything OK. So it seems that PostgreSQL 8.4 does not work with the old syntax of itself.
Teradata Employee

Re: Error in installing PDK 13.02

Viewpoint is supported on Postgres 8.1.5 and 8.3.9.