[SQL] Create index on xml field
Could somebody please help me with the correct syntax for creating an index on
an xml field. My (simple) table format is:
CREATE TABLE test_tbl (id_cd integer not null, job xml);
INSERT INTO test_tbl VALUES (200,
'http://www.cmpy.com/uim";>202038137003600601236');
I've tried multiple ways of creating an idex on the element but
always get an ERROR: could not create XPath object.
Why would the following not work?
create index tstTbl_idx on test_tbl (cast(xpath ('//uim:upcCode/text()', job)
as text[]));
Thanks
Re: [SQL] Create index on xml field
On Tuesday 13 January 2009 18:56:33 Brad Balmer wrote:
> Why would the following not work?
> create index tstTbl_idx on test_tbl (cast(xpath ('//uim:upcCode/text()',
> job) as text[]));
Looks like you are missing a namespace definition.
--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] some howto/theory book/tutorial on practical problem solving in SQL
On Jan 11, 2009, at 8:32 AM, Ivan Sergio Borgonovo wrote: I'm looking to some book/tutorial/sample code that will teach me how to use SQL to solve some standard problem that goes a bit beyond using group by and aggregates. Something like "SQL problem solving" or "SQL design strategies for selected problems". O'Reilly's SQL Hacks is a good one that fits the bill you describe. Erik Jones, Database Administrator Engine Yard Support, Scalability, Reliability 866.518.9273 x 260 Location: US/Pacific IRC: mage2k -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
