How do I cast type aclitem to text or varchar in psql?
I am attempting to do a like/~ operation with an aclitem and am having
problems. I cannot cast this type to a text or varchar type, so I am
unable to use the like or ~ operators. I am having the same trouble with
the cstring type. My guess is that this is somehow enumerated, but I can't
seem to find the key. Any ideas?
This is the type of query I'd like to run:
select
case when relacl[1] ~ '%searchstring%' then 1 else 0 end as temp1,
case when relacl[1] like '%searchstring%' then 1 else 0 end as temp2,
case when aclitemout(relacl[1]) ~ '%searchstring%' then 1 else 0 end as
temp3,
case when aclitemout(relacl[1]) like '%searchstring%' then 1 else 0 end
as temp4,
relacl[1]::text as temp5,
relacl[1]::varchar as temp6,
aclitemout(relacl[1])::text as temp7,
aclitemout(relacl[1])::varchar as temp8
from
pg_class c
;
No comments:
Post a Comment