[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] GNUmed server v 11.1 -cannot bootstrap bundles
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] GNUmed server v 11.1 -cannot bootstrap bundles |
Date: |
Fri, 30 Oct 2009 14:20:20 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hello Jason,
> I am currently running CentOS and postgresql-8.4.0 to try
> to boostrap the gnumed server v11.1 to my postgres database.
...
> 2009-10-28 06:17:06 ERROR
> ../sql/v9-v10/dynamic/v10-gm-role_management-dynamic.sql:263: loop variable
> of loop over rows must be record or row variable at or near "LOOP" at
> character 496
All three loop variables ("FOR _user") are of type text:
create or replace function gm.get_users(name)
...
DECLARE
_user text;
BEGIN
FOR _user in
select distinct rolname from pg_roles where oid in (
select member from pg_auth_members where roleid in (
select oid from pg_roles where rolname in
(''gm-logins'', ''gm-public'', _db)
)
)
LOOP
...
END LOOP;
FOR _user in select distinct modified_by from audit.audit_fields LOOP
...
END LOOP;
FOR _user in select distinct db_user from dem.staff LOOP
...
END LOOP;
END;'
This is what the 8.4 manual says about FOR LOOP variables:
38.6.4. Looping Through Query Results
Using a different type of FOR loop, you can iterate through the results
of a query and manipulate that data accordingly. The
syntax is:
[ <<label>> ]
FOR target IN query LOOP
statements
END LOOP [ label ];
The target is a record variable, row variable, or comma-separated list
of scalar variables.
Note the "comma-separated list of scalar variables". This
works flawlessly for me on 8.4.1 on Debian. The 8.4.1
release notes show no change regarding FOR LOOP targets:
http://www.postgresql.org/docs/8.4/static/release-8-4-1.html
Are you entirely sure this is PostgreSQL 8.4 ? It was a
fairly recent change.
If so, I'd suggest asking CentOS about it. It surely is
expected to work (it does work here).
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346