Thanks David for your quick response. My original objective was to get the
value of a particular node in xml which is stored as text datatype in the
table.
For example :
--16
I want to extract the value of amperage as '16'. Like that I may have many
nodes in xml want to get the report to show
Hi,
My current database version is "PostgreSQL 9.1.11 on
x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat
4.4.7-3), 64-bit".
I am trying to use function xpath in my query and got following error.
"ERROR: function xpath(unknown, text) does not exist at character 8
HINT:
sparikh wrote
> Thanks David for your quick response. My original objective was to get the
> value of a particular node in xml which is stored as text datatype in the
> table.
>
> For example :
>
>
>
> -
>
> -
>
>
> 16
>
>
>
>
> I want to extract the value of amperage as '16'. Like that
sparikh wrote
> Hi,
>
> My current database version is "PostgreSQL 9.1.11 on
> x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat
> 4.4.7-3), 64-bit".
>
> I am trying to use function xpath in my query and got following error.
>
> "ERROR: function xpath(unknown, text) does
On 19/07/10 05:41, Irooniam wrote:
> However, when I check which index it's using, it's not using the xpath
> index:
> explain select * from test where ((xpath('//names/name[. ="bob"]/text()',
> data))[1]::text) = 'bob';
>QUERY
> PLAN
> -
Hello,
I've searched the mailing list and I tried using defining a xpath index per
the post, but my query is still not using it.
Essentially, I'm storing a fragment of xml and I want to create xpath
indexes on them.
The two rows I'm going to insert look like this (alex & bob are the only
names r
Figured it out , thanks for all your help ( had missing brackets )
Here is the sql statement
CREATE INDEX xml_index
ON time_series
USING btree
((
(xpath('/AttributeList/Attributes/Attribute/Name/text()',
external_attributes))[1]::text));
Thanks
Chris
On Fri, Mar 5, 2010 at 4:18 PM, Chr
Thanks for your fast response
I have the following sql statement now :
CREATE INDEX xml_index
ON time_series
USING btree
(xpath('/AttributeList/Attributes/Attribute/Name/text()',external_attributes))[1]::text
And I am getting the following error :
ERROR: syntax error at or near "["
LINE 6
Chris Roffler writes:
> I am trying to setup an index on an xpath expression but the query never
> uses the index.
> Could someone enlighten me please ?
> Here is the setup :
> CREATE INDEX xml_index
> ON time_series
> USING btree
> ((xpath('/AttributeList/Attributes/Attribute/Name/text()'
I am trying to setup an index on an xpath expression but the query never
uses the index.
Could someone enlighten me please ?
Here is the setup :
CREATE TABLE time_series
(
id bigint NOT NULL,
"name" character varying NOT NULL,
"timestamp" timestamp with time zone NOT NULL,
start_date time
try to cast to "xml" xml_payload::xml
El mié, 10-02-2010 a las 12:39 +0300, Allan Kamau escribió:
> As advised by Peter,
> Below is an example (including the ddl and dml statements), it _drops_
> and creates a table called "simple_table" and a sequence called
> "simple_table_seq" both in th
As advised by Peter,
Below is an example (including the ddl and dml statements), it _drops_
and creates a table called "simple_table" and a sequence called
"simple_table_seq" both in the "public" schema.
DROP SEQUENCE IF EXISTS simple_table_seq CASCADE;
CREATE SEQUENCE simple_table_seq;
DROP TABLE
On Wed, Feb 10, 2010 at 11:34 AM, Otandeka Simon Peter
wrote:
> Allan,
>
> Postgres is very strict on variable types and char conversion. I have a
> feeling you are trying to access data from a varchar feild using an
> integer...
>
> Can you paste here your schema for that table?
>
> P.
>
> On We
Allan,
Postgres is very strict on variable types and char conversion. I have a
feeling you are trying to access data from a varchar feild using an
integer...
Can you paste here your schema for that table?
P.
On Wed, Feb 10, 2010 at 11:06 AM, Allan Kamau wrote:
> Hi,
> I am running postgreSQL
Hi,
I am running postgreSQL-8.4.2. I have a table that stores a single xml
document per row in one of it's fields. I would like to use xpath to
retrieve portions of these xml documents.
Is there a way to do so. (I am running postgreSQL 8.4.2 configured
(built) with --with-libxml and --with-libxslt
I wrote:
> [...]
> You have to put brackets around the function call:
> | select (xpath('/trade/trade-info/id/text()', cast(xml as xml)))[1] as id
> from risk.trade_table;
... or, after a look in the dictionary, whatever you call
"(" and ")" :-).
Tim
--
Sent via pgsql-general mailing list (
Karl Koster wrote:
> It looks like I have to abandon xml2 functions in PostgreSQL
> 8.4. The problem is I can't seem to find an incantation of
> xpath that will perform the same thing. I have tried the
> following snippet:
> select xpath('/trade/trade-info/id/text()', cast(xml as
> xml))[1] as i
It looks like I have to abandon xml2 functions in PostgreSQL 8.4. The
problem is I can't seem to find an incantation of xpath that will
perform the same thing. I have tried the following snippet:
select xpath('/trade/trade-info/id/text()', cast(xml as xml))[1] as id
from risk.trade_table
whi
Sam Mason wrote:
On Sun, Jul 12, 2009 at 09:49:15PM +0100, Roy Walter wrote:
Where exactly does that fit in terms of my original query, i.e.:
SELECT x
FROM (SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml)
AS x FROM docs) AS y WHERE x <> [test for empty array?
On Sun, Jul 12, 2009 at 09:49:15PM +0100, Roy Walter wrote:
> Where exactly does that fit in terms of my original query, i.e.:
>
>SELECT x
>FROM (SELECT xpath('//entry[contains(p, ''searchtext'')]/@*', docxml)
>AS x FROM docs) AS y WHERE x <> [test for empty array?]
Something
Scott Bailey wrote:
Sam Mason wrote:
On Sun, Jul 12, 2009 at 06:41:57PM +0100, Roy Walter wrote:
Scott Bailey wrote:
Roy Walter wrote:
How do I test for an empty array in postgres?
WHERE x != array[]::xml[]
Thanks Scott but that throws up a syntax error (at the closing
bracket of array[]
Sam Mason wrote:
On Sun, Jul 12, 2009 at 06:41:57PM +0100, Roy Walter wrote:
Scott Bailey wrote:
Roy Walter wrote:
How do I test for an empty array in postgres?
WHERE x != array[]::xml[]
Thanks Scott but that throws up a syntax error (at the closing bracket
of array[]):
ERROR: synta
On Sun, Jul 12, 2009 at 06:41:57PM +0100, Roy Walter wrote:
> Scott Bailey wrote:
> >Roy Walter wrote:
> >>How do I test for an empty array in postgres?
> >
> >WHERE x != array[]::xml[]
> >
> >
> Thanks Scott but that throws up a syntax error (at the closing bracket
> of array[]):
>
>ERROR:
Scott Bailey wrote:
Roy Walter wrote:
In postgres 8.4 When running xpath() queries it seems that empty
results are always returned. So if I query a table containing 1000
XML documents a 1000 rows will always be fetched even if the xpath()
element of the query only matches 10 documents.
The d
Roy Walter wrote:
In postgres 8.4 When running xpath() queries it seems that empty results
are always returned. So if I query a table containing 1000 XML documents
a 1000 rows will always be fetched even if the xpath() element of the
query only matches 10 documents.
The documentation states:
In postgres 8.4 When running xpath() queries it seems that empty results
are always returned. So if I query a table containing 1000 XML documents
a 1000 rows will always be fetched even if the xpath() element of the
query only matches 10 documents.
The documentation states:
The function |x
On Thursday 19 February 2009 16:46:42 Francisco wrote:
> Hi List,
> I have installed postgreSQL 8.3 in my Ubuntu Hardy Heron.
> I want to use xpath functions (like xpath_table), but I can't. An error
> appears "xpath_table does not exists".
> How could I intregrate xpath funtions with my postgreSQL
I have executed pg_config and I have the libxml. I think the problem is that
xml2 is not enabled, any idea how to enable it?
2009/2/19 Osvaldo Kussama
> 2009/2/19 Francisco :
> > I saw it,but it says:
> > "Use of many of these functions requires the installation to have been
> built
> > with con
I saw it,but it says:
"Use of many of these functions requires the installation to have been built
with configure --with-libxml"
When I installed postgreSQL I did not include this option, have I to
reinstall postgresql?
2009/2/19 Osvaldo Kussama
> 2009/2/19 Francisco :
> > Hi List,
> > I have i
Hi List,
I have installed postgreSQL 8.3 in my Ubuntu Hardy Heron.
I want to use xpath functions (like xpath_table), but I can't. An error
appears "xpath_table does not exists".
How could I intregrate xpath funtions with my postgreSQL without
reinstalling it?
Any solution?
Thanks ;)
With XML similar to:
< a >
< b >
< c > 1
< c > 2
< c > 3
I'm trying to create an xpath expression (for a postgresql query) that will
return if is a particular value and not that is all three values.
What I currently have (which does not work) is:
select * from someTable where xpat
On 3/4/07, Peter Schonefeld <[EMAIL PROTECTED]> wrote:
Hi, i'm having trouble getting xpath in Postgres 8.2 to recognise xml
namespaces...could someone please point me to a good reference for the xml2
lib?
This is FAQ-like question.
The thing is that XPath spec doesn't define any default mappin
Hi, i'm having trouble getting xpath in Postgres 8.2 to recognise xml
namespaces...could someone please point me to a good reference for the xml2
lib?
Cheers
Pete
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of John Gray
> Sent: 29 August 2006 22:49
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] XPath and XML support
>
> On Thu, 24 Aug 2006 13:56:12 -0700, Frank Co
On Thu, 24 Aug 2006 13:56:12 -0700, Frank Cohen wrote:
> Thanks Nikolay: Seeing as xml2 hasn't been ported to Windows yet
> makes me wonder if this is going to be the best way to use XML in
> PostgreSQL in the long-term? Is there anything else on the boards? -
> Frank
>
There's a lot of sco
Thanks Nikolay: Seeing as xml2 hasn't been ported to Windows yet
makes me wonder if this is going to be the best way to use XML in
PostgreSQL in the long-term? Is there anything else on the boards? -
Frank
On Aug 24, 2006, at 4:17 AM, Nikolay Samokhvalov wrote:
On 8/24/06, Jeff Davis <[E
On 8/24/06, Jeff Davis <[EMAIL PROTECTED]> wrote:
On Wed, 2006-08-23 at 16:04 -0700, Frank Cohen wrote:
>
> These look like good XPath functions. Are they actually in PSQL
> 8.1.4? I did not find them in the Windows installed version. If not,
> are they recommended?
Look at contrib/xml2. The fun
On Wed, 2006-08-23 at 16:04 -0700, Frank Cohen wrote:
> I'm doing a performance and scalability test project for a PostgreSQL
> user who is working with geospatial data. The data is in GML form.
> For instance:
>
>
>
>
>
>http://www.opengis.net/gml";>
> 7.0,9.0
>
>
>
>
>
>
I'm doing a performance and scalability test project for a PostgreSQL
user who is working with geospatial data. The data is in GML form.
For instance:
http://www.opengis.net/gml";>
7.0,9.0
I installed PostGIS and it supports Point and coordinates very well.
I an not sure wha
> Since you brought up the subject, will this
> //[EMAIL PROTECTED] = "02"]
> be slower than
> /mydocument/body/chapter/contents/[EMAIL PROTECTED]
> >> = "02"]
> when handling a big document?
> I mean from the query time point of view ...
I have no idea about the postgres XML implementation int
Thank you!
Since you brought up the subject, will this
//[EMAIL PROTECTED] = "02"]
be slower than
/mydocument/body/chapter/contents/[EMAIL PROTECTED]
>> = "02"]
when handling a big document?
I mean from the query time point of view ...
Csaba Nagy wrote:
> Marian,
>
>> 1.
>> SELECT
>>
Marian,
> 1.
> SELECT
> xpath_nodeset(xml_data, '/mydocument/body/chapter/contents/[EMAIL
> PROTECTED]
> = "02"]|/mydocument/body/[EMAIL PROTECTED]"87"]')
> FROM xmltable
> WHERE id = 3
You could maybe use the xpath: '//[EMAIL PROTECTED] = "02"]' if you want
all paragraphs at all docume
You are right; I had a typo : contents is content
Thanks for replying ...
Guy Rouillier wrote:
> Marian POPESCU wrote:
>> There is also a weird thing:
>>
>>
>> SELECT
>> xpath_nodeset(rawdata,
>> '/mydocument/body/chapter/contents/paragraph') FROM xmldocuments
>>
>> will output
>>
>> xpath
It looks that I shoot myself in the foot :(
CREATE TABLE xmltable
(
id int8 NOT NULL,
xml_data text,
CONSTRAINT pk_xmltable PRIMARY KEY (id)
)
WITHOUT OIDS;
The id field contains values from 1 to 3.
The field xml_data contains something like this:
My document
Marian,
On Mon, 2006-08-07 at 17:47, Marian POPESCU wrote:
> SELECT
> xpath_nodeset(rawdata, '/mydocument/body/chapter/contents/paragraph')
> FROM xmldocuments
>
> will output
>
> xpath_nodeset
>
> (empty line)
> (empty line)
> (emp
Marian POPESCU wrote:
> There is also a weird thing:
>
>
> SELECT
> xpath_nodeset(rawdata,
> '/mydocument/body/chapter/contents/paragraph') FROM xmldocuments
>
> will output
>
> xpath_nodeset
>
> (empty line)
> (empty line)
> (empty line)
> (empty line)
>
> 4 record(s
Thanks for replying.
It was a typo ...
Also id fom example should be objid ...
Anyway, without the typo, the result set is empty.
There is also a weird thing:
SELECT
xpath_nodeset(rawdata, '/mydocument/body/chapter/contents/paragraph')
FROM xmldocuments
will output
xpath_nodeset
[snip]
>
[snip]
> xpath_bool(rawdata,'/mydocument/body/chapter/contents/paragraph[objid="2_1"]');
^
To me it looks like attribute name mismatch, n
Hello everyone,
First of all, thank you for integrating XPath in Postgresql.
But, as you will see, this is a desperate cry for help:
1. the actual context:
Postgresql 8.1.4, Fedora Core 5
DATABASE
=
CREATE TABLE xmldocuments
(
id int8 NOT NULL,
rawdata text,
title varchar(255),
49 matches
Mail list logo