Retrieving Array/ADT fields

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
Paulonki
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 24.03.2006, 17:50

Retrieving Array/ADT fields

Post by Paulonki »

Hello,

The sql form pgsl 8.2.5 for retieving "Access Privileges" raise exception EAccessViolation:

sq := 'SELECT n.nspname as "Schema",' +
'c.relname as "Name",' +
'CASE c.relkind WHEN ''r'' THEN ''table'' ' +
'WHEN ''v'' THEN ''view'' ' +
'WHEN ''S'' THEN ''sequence'' ' +
'END as "Type",' +
'c.relacl as "Access privileges" ' +
'FROM pg_catalog.pg_class c ' +
'LEFT JOIN pg_catalog.pg_namespace n ' +
'ON n.oid = c.relnamespace ' +
'WHERE c.relkind IN (''r'', ''v'', ''S'') ' +
' AND c.relname ~ ''^(' + 'mytable' + ')$'' ' +
' AND n.nspname !~ ''^pg_'' ' +
'AND pg_catalog.pg_table_is_visible(c.oid) ' +
'ORDER BY 1, 2;';

with dm.zq1 do
begin
Close;
SQL.Clear;
SQL.Add( sq );
Open;
end;

Removing piece for field 'relacl' this works fine. In manual PG this appear in pg_catalog.pg_class.relacl - aclitem[]. It contents array of privilege access for tables. I using Zeos 6.6.2-BETA/Delphi 2006.

How solve it?

Regards,

Paulo
Post Reply