ltree and PHP

Started by Open _about 5 years ago2 messagesgeneral
Jump to latest
#1Open _
opensheart@yahoo.com

I've created the ltree extensioncreated a table with an ltree column called ltree_path
In php I can access the table, insert, update, delete.but ltree operators don't work.
select count() from schema.table 
where 'A.B.C' @> ltree_path;
gives me a "could not determine polymorphic type anyrange because input has type unknown'
The same statement works just fine in psql, but not in PHP
If I change the statement to:

select count() from schema.table 
where cast('A.B.C' as schema.ltree) @> ltree_path;
I get a different error: "operator does not exist:"
pointing to the @>
Is there someplace to 'create' or include ltree in PHP ?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Open _ (#1)
Re: ltree and PHP

Open _ <opensheart@yahoo.com> writes:

I've created the ltree extensioncreated a table with an ltree column called ltree_path
In php I can access the table, insert, update, delete.but ltree operators don't work.

It sounds like the ltree extension is in a schema that's not in the
search_path setting you're using from PHP.

regards, tom lane