create table Resource (
resource_id serial primary key,
parent_id int references Resource(resource_id),
nodename text not null,
iscollection boolean not null default false,
lastmodified timestamp not null default current_date,
creationdate timestamp not null default current_date,
contentlength bigint not null default 0,
etag uuid,
resoid oid,
unique(parent_id, nodename)
);
create table Property (
property_id serial primary key,
resource_id int references Resource(resource_id) on delete cascade,
prefix text not null,
xmlns text not null,
pname text not null,
lang text,
nsdeflist text,
pvalue text,
unique(resource_id, xmlns, pname)
);
create type property_name as (
xmlns text,
name text
);