Re: [GENERAL] xml-file as foreign table?

2016-05-09 Thread Johann Spies
Thanks Arjen, > def q(v): > return b'"' + v.replace(b'"', b'""') + b'"' > > return b','.join(q(f) for f in fields) + b'\n' > > In the end I also had some other problems with the XML (namespaces), so I > used: > > etree.tostring(element, method='c14n', exclusive=True) > This helped. My code

Re: [GENERAL] xml-file as foreign table?

2016-05-06 Thread Arjen Nienhuis
On Thu, May 5, 2016 at 2:13 PM, Johann Spies wrote: > Dankie Arjen, > > On 29 April 2016 at 07:01, Arjen Nienhuis wrote: > >> >> > The options I am considering is : >> > >> > 1. Unpack the individual records (will be more than 50 million) using >> > something like python with lxml and psycopg2 an

Re: [GENERAL] xml-file as foreign table?

2016-04-28 Thread Arjen Nienhuis
On Apr 28, 2016 14:33, "Johann Spies" wrote: > > I have several large (7GB+) xml files to get into an SQL database. > > The xml-files can contain up to 500 000 subrecords which I want to be able to query in the database. > > They are too large to do something like this: > > > insert into rawxml (x

Re: [GENERAL] xml

2015-03-23 Thread Pavel Stehule
2015-03-23 15:09 GMT+01:00 Tom Lane : > Pavel Stehule writes: > > result of xmlagg is not valid xml. > > Really? Either that's a bug, or it's declared wrong. > I was not accurate. "" is not valid xml document - and xpath function doens't like it. postgres=# select xpath('//tag/@x',''::xml); ER

Re: [GENERAL] xml

2015-03-23 Thread Tom Lane
Pavel Stehule writes: > result of xmlagg is not valid xml. Really? Either that's a bug, or it's declared wrong. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mail

Re: [GENERAL] xml

2015-03-23 Thread Pavel Stehule
2015-03-23 12:40 GMT+01:00 Ramesh T : > Hi all, > SELECT xmlagg(xmlelement( > name actor, xmlattributes(first_name) > )ORDER BY actor_id,',')from actor; > > the above code return following result, > > [image: Inline image 1] > Questio

Re: [GENERAL] {xml}

2014-08-07 Thread David G Johnston
Ramesh T wrote > Hello, > when i ran following query on postgres 9.3, > SELECT xmlagg(xmlelement(name e,part_id||',')) from part; > > result > .. > {xml} > > how to get part_id's..? please let me know .. > advance thanks, > R.. Are you using psql? What version of Pos

Re: [GENERAL] XML validation of whitespace values

2014-05-11 Thread David G Johnston
Tim Kane wrote > clone=# create temp table xml_test (document xml); > CREATE TABLE If you know you need to use xpath on this content then you should do one of the following: SELECT CASE WHEN document IS DOCUMENT THEN xpath(...) ELSE default_value_for_missing_data END; CREATE TABLE xml_test ( doc

Re: [GENERAL] XML validation of whitespace values

2014-05-11 Thread Peter Eisentraut
On 3/14/14, 11:12 AM, Tim Kane wrote: > clone=# select xml_is_well_formed(' '); > xml_is_well_formed > > t > (1 row) > > > clone=# select xpath_exists (‘//test', ' '); > ERROR: could not parse XML document > DETAIL: line 1: Start tag expected, '<' not found There are sev

Re: [GENERAL] xml question

2014-04-28 Thread David G Johnston
David Ekren wrote > I am new to this forum. I need to return the value 1 between the > orientationId tags in this xml string within the function below. I still > get errors. I'm sure I am doing something wrong. Any help would be > appreciated. > > > CREATE FUNCTION Davidxml9(v_clipId integer, v_o

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-17 Thread Edson Richter
Em 17/12/2012 20:14, Thomas Kellerer escreveu: Edson Richter wrote on 14.12.2012 00:52: I was wondering to create a tool for diagramming and database forward engineering. There are already few tools around. If you know a good diagramming tool able to database diff and forward engineering (wi

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-17 Thread Thomas Kellerer
Edson Richter wrote on 14.12.2012 00:52: I was wondering to create a tool for diagramming and database forward engineering. There are already few tools around. If you know a good diagramming tool able to database diff and forward engineering (with "ALTER ...", not "DROP and CREATE"), I would

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-17 Thread Guillaume Lelarge
On Sun, 2012-12-16 at 22:25 -0200, Edson Richter wrote: > Em 16/12/2012 20:27, Guillaume Lelarge escreveu: > > On Fri, 2012-12-14 at 14:17 -0200, Edson Richter wrote: > >> Em 14/12/2012 12:21, Merlin Moncure escreveu: > >>> On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter > >>> wrote: > Em 13/

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-16 Thread Edson Richter
Em 16/12/2012 20:27, Guillaume Lelarge escreveu: On Fri, 2012-12-14 at 14:17 -0200, Edson Richter wrote: Em 14/12/2012 12:21, Merlin Moncure escreveu: On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter wrote: Em 13/12/2012 20:10, Merlin Moncure escreveu: [...] *) diagram output should be standar

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-16 Thread Guillaume Lelarge
On Fri, 2012-12-14 at 14:17 -0200, Edson Richter wrote: > Em 14/12/2012 12:21, Merlin Moncure escreveu: > > On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter > > wrote: > >> Em 13/12/2012 20:10, Merlin Moncure escreveu: > >>[...] > > > *) diagram output should be standard html (only) without requir

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-14 Thread Merlin Moncure
On Fri, Dec 14, 2012 at 10:17 AM, Edson Richter wrote: > Em 14/12/2012 12:21, Merlin Moncure escreveu: > >> On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter >> wrote: >>> >>> Em 13/12/2012 20:10, Merlin Moncure escreveu: >>> On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter wrote:

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-14 Thread Atri Sharma
On Fri, Dec 14, 2012 at 9:47 PM, Edson Richter wrote: > Em 14/12/2012 12:21, Merlin Moncure escreveu: > > On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter >> wrote: >> >>> Em 13/12/2012 20:10, Merlin Moncure escreveu: >>> >>> On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter < edsonrich...@hotm

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-14 Thread Edson Richter
Em 14/12/2012 12:21, Merlin Moncure escreveu: On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter wrote: Em 13/12/2012 20:10, Merlin Moncure escreveu: On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter wrote: Has anyone created a XML Schema that would represent PostgreSQL database with all (or at le

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-14 Thread Merlin Moncure
On Thu, Dec 13, 2012 at 5:52 PM, Edson Richter wrote: > Em 13/12/2012 20:10, Merlin Moncure escreveu: > >> On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter >> wrote: >>> >>> Has anyone created a XML Schema that would represent PostgreSQL database >>> with all (or at least, major) structures? >> >>

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-13 Thread Edson Richter
Em 13/12/2012 20:10, Merlin Moncure escreveu: On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter wrote: Has anyone created a XML Schema that would represent PostgreSQL database with all (or at least, major) structures? no -- furthermore, why would you want to? what would be the consumer of this '

Re: [GENERAL] XML Schema for PostgreSQL database

2012-12-13 Thread Merlin Moncure
On Thu, Dec 13, 2012 at 1:54 PM, Edson Richter wrote: > Has anyone created a XML Schema that would represent PostgreSQL database > with all (or at least, major) structures? no -- furthermore, why would you want to? what would be the consumer of this 'schema'? merlin -- Sent via pgsql-general

Re: [GENERAL] XML Encoding problem

2011-02-09 Thread Radosław Smogura
I may write some patch, actually text mode will not be affected, becuase it's text mode, and patch will fail if client encoding is "reacher" then server (one possiblity in this situation is to XML-encode to client encoding, text- rencode to server encoding) But looking at code same thing could o

Re: [GENERAL] XML Encoding problem

2011-02-09 Thread Peter Eisentraut
On mån, 2011-02-07 at 12:44 +0100, rsmogura wrote: > I have test database with UTF-8 encoding. I putted there XML > ЁĄ¡, (U+0401, U+0104, U+00A1). I changed client encoding to > iso8859-2, as the result of select I got > ERROR: character 0xd081 of encoding "UTF8" has no equivalent in > "LAT

Re: [GENERAL] XML - DOCTYPE element - documentation suggestion

2010-06-28 Thread Peter Eisentraut
On fre, 2010-06-18 at 02:43 +0800, Craig Ringer wrote: > The xml datatype documentation should probably mention that whole > documents must be loaded with an XMLPARSE(DOCUMENT 'doc_text_here), > they > cannot just be cast from text to xml as happens when you pass an xml > document as text to a para

Re: [GENERAL] XML index

2010-05-27 Thread Chris Roffler
Changed the create index statement to : USING hash and it seems to work. Any idea why btree does not work ? Thanks Chris On Thu, May 27, 2010 at 3:47 PM, Chris Roffler wrote: > Tried that same thing > > > On Thu, May 27, 2010 at 1:53 PM, Thom Brown wrote: > >> On 27 May 2010 12:22, Chr

Re: [GENERAL] XML index

2010-05-27 Thread Chris Roffler
Tried that same thing On Thu, May 27, 2010 at 1:53 PM, Thom Brown wrote: > On 27 May 2010 12:22, Chris Roffler wrote: > > I have a table with an xml column, created an index as follows: > > CREATE INDEX xml_index > > ON test > > USING btree > > (((xpath('//*/ChangedBy/text()'::text,

Re: [GENERAL] XML index

2010-05-27 Thread Thom Brown
On 27 May 2010 12:22, Chris Roffler wrote: > I have a table with an xml column, created an index as follows: > CREATE INDEX xml_index >   ON test >   USING btree >   (((xpath('//*/ChangedBy/text()'::text, external_attributes))[1]::text)); > And here is my select statement: > Select uuid from t >  

Re: [GENERAL] XML Index again

2010-03-08 Thread Chris Roffler
Yup you are right however I am trying to run benchmarks with the two solutions. The xml solution will give us more flexibility in the future , just in case we do not have attribute/value lists :) On Mon, Mar 8, 2010 at 1:33 PM, Alban Hertroys < dal...@solfertje.student.utwente.nl> wrote: >

Re: [GENERAL] XML Index again

2010-03-08 Thread Alban Hertroys
On 8 Mar 2010, at 13:23, Chris Roffler wrote: > Alban > > thanks for your response. I understand what you are saying . > > >Your previous query wasn't about attributes in any specific position - it > >returned documents that contained >more than zero attributes matching a > >given name. Wh

Re: [GENERAL] XML Index again

2010-03-08 Thread Chris Roffler
Alban thanks for your response. I understand what you are saying . >Your previous query wasn't about attributes in any specific position - it returned documents that contained >more than zero attributes matching a given name. What are you trying to do this time? And that is exactly my proble

Re: [GENERAL] XML Index again

2010-03-08 Thread Alban Hertroys
On 8 Mar 2010, at 11:39, Chris Roffler wrote: > Alban > > Thanks for your help, your suggestion worked. > > I need another xpath expression to find any Attribute with Name ="" > under the Attributes node. (not just if it is in a specific position) > see query below. > How do I create an

Re: [GENERAL] XML Index again

2010-03-08 Thread Alban Hertroys
On 8 Mar 2010, at 11:39, Chris Roffler wrote: > Alban > > Thanks for your help, your suggestion worked. > > I need another xpath expression to find any Attribute with Name ="" > under the Attributes node. (not just if it is in a specific position) > see query below. Your previous query

Re: [GENERAL] XML Index again

2010-03-08 Thread Chris Roffler
Alban Thanks for your help, your suggestion worked. I need another xpath expression to find any Attribute with Name ="" under the Attributes node. (not just if it is in a specific position) see query below. How do I create an index for this xpath expression ? Thanks Chris SELECT * FROM

Re: [GENERAL] XML Index again

2010-03-07 Thread Chris
Alban thanks for your replay. Yes I am looking for node exists ... I'll give it a roll. >There are a couple of cases where Postgres won't use your index, but in this >case it's quite clearly because you're asking for (quite) a different >expression than the one you indexed. > >You seem to wa

Re: [GENERAL] XML Index again

2010-03-07 Thread Alban Hertroys
On 7 Mar 2010, at 11:02, Chris Roffler wrote: > I still have some problems with my xml index > > CREATE INDEX xml_index > ON time_series > USING btree > (( > (xpath('/AttributeList/Attributes/Attribute/Name/text()', > external_attributes))[1]::text)); > > When I run the following query

Re: [GENERAL] XML performance tuning

2010-03-06 Thread Bruce Momjian
Chris Roffler wrote: > Are there any guidelines for XML performance tuning ? Uh, no, I have never seen any. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do --

Re: [GENERAL] XML Type validates against xml schema?

2010-01-06 Thread Peter Eisentraut
On tis, 2010-01-05 at 16:06 -0800, Andrew Lardinois wrote: > Poking around in the 8.5 Devel Documentation section 8.13.1, the XML > Type, I noticed that: > > "The xml type does not validate input values against a document type > declaration (DTD), even when the input value specifies a DTD" > > I

Re: [GENERAL] xml import/export tools and performance

2009-11-06 Thread John R Pierce
Ivan Sergio Borgonovo wrote: I know one of the exporting parties will be a MS SQL 2005 server, so it would be nice if there was an easy way to import xml generated with the FOR XML AUTO, XMLSCHEMA ('forpg'). Microsoft SQL Server has a pretty good data translation tool, it used to be called

Re: [GENERAL] xml import/export tools and performance

2009-11-06 Thread Brian Modra
2009/11/6 Ivan Sergio Borgonovo : > I need to import/export through xml files. > > I was looking for tools/examples/HOWTO for postgresql. > > Right now I still don't know the details of the requirements. > > I know I won't need a GUI. > > I know one of the exporting parties will be a MS SQL 2005 se

Re: [GENERAL] xml to string, ascii x utf8 conversion

2009-07-21 Thread Peter Eisentraut
On Monday 20 July 2009 19:46:01 Radek Novotný wrote: > query_to_xml('select Nazev as "TITLE", Datum as "DATE", Autor_Akce as "meta > rel=''action_author''", > > gave me > > http://www.w3.org/2001/XMLSchema-instance";> > > Test > 2009-07-20 > test > > > How can i transcode this well gen

Re: [GENERAL] XML import with DTD

2009-07-11 Thread Roy Walter
Doh! That's it. Thanks a million. -- Roy Tom Lane wrote: Roy Walter writes: This one does not: INSERT INTO wms_collection (docxml) VALUES (XMLPARSE(content( ' ]> Shoes '))) What I know about XML wouldn't fill a thimble, but shouldn't you

Re: [GENERAL] XML import with DTD

2009-07-11 Thread Tom Lane
Roy Walter writes: > This one does not: > INSERT INTO wms_collection (docxml) VALUES (XMLPARSE(content( > ' > [ > > > ]> > > Shoes > '))) What I know about XML wouldn't fill a thimble, but shouldn't you say DOCUMENT not CONTENT if you are trying to pro

Re: [GENERAL] XML import with DTD

2009-07-11 Thread Roy Walter
It's not an xpath problem it's an XML import problem. Sorry if I wasn't clear. Consider the following example queries. This one works fine: INSERT INTO wms_collection (docxml) VALUES (XMLPARSE(content( ' Shoes '))) This one does not: INSERT INTO wms_collection (docxml) VALU

Re: [GENERAL] XML import with DTD

2009-07-10 Thread artacus
Post a snippet of the xml and xpath you are trying to use. Scott - Original Message - From: "Roy Walter" To: pgsql-general@postgresql.org Sent: Friday, July 10, 2009 7:49:00 AM GMT -08:00 US/Canada Pacific Subject: [GENERAL] XML import with DTD Hi I'm trying to use the XPath f

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-07 Thread Grzegorz Jaśkiewicz
I can test/review the code, if you want. It would be a nice thing to have in postgresql, obviously once you prepare statement enough to convince Tom :) XSLT is a necessity , otherwise it won't be standard, and thus - quite useless. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-07 Thread Peter Eisentraut
On Monday 01 June 2009 12:53:08 Grzegorz Jaśkiewicz wrote: > is there any way currently to convert xml file in format like below, > to a table ? I have some code that does this, but it was written a long time ago and will probably need some polishing. One main problem is how you specify that exa

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Scott Bailey
Pavel Stehule wrote: 2009/6/1 Grzegorz Jaśkiewicz : That's one of things pg xml type lacks ... :/ yes - SQL/XML isn't completed yet http://wiki.postgresql.org/wiki/XML_Support :( I believe so some procedure like xml_to_table should be nice. but plperlu code should be simple (as perl code sh

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Pavel Stehule
2009/6/1 Grzegorz Jaśkiewicz : > That's one of things pg xml type lacks ... :/ yes - SQL/XML isn't completed yet http://wiki.postgresql.org/wiki/XML_Support :( I believe so some procedure like xml_to_table should be nice. but plperlu code should be simple (as perl code should be :)) and fast

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Grzegorz Jaśkiewicz
That's one of things pg xml type lacks ... :/ I just need that to get some real xml, and convert to table once, so I should be fine with xpath, but ... heh. This is so ugly. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.post

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Pavel Stehule
Hello you can use simple perl parser an sample is on http://www.postgres.cz/index.php/PL/Perlu_-_Untrusted_Perl#Generov.C3.A1n.C3.AD.2C_zpracov.C3.A1n.C3.AD_XML code is in english and perl, description in czech, sorry regards Pavel Stehule 2009/6/1 Grzegorz Jaśkiewicz : > xpath is fine, but no

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Sam Mason
On Mon, Jun 01, 2009 at 11:22:14AM +0100, Grzegorz Jaaakiewicz wrote: > xpath is fine, but not when you have 10+ fields to extract ;) I've got a few views pulling 10 to 15 values out of XML files and it works OK, not amazing performance but for what I'm doing it's no problem. Scaling beyond that

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Grzegorz Jaśkiewicz
xpath is fine, but not when you have 10+ fields to extract ;) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] xml to table (as oppose to table to xml)

2009-06-01 Thread Sam Mason
On Mon, Jun 01, 2009 at 10:53:08AM +0100, Grzegorz Jaaakiewicz wrote: > is there any way currently to convert xml file in format like below, > to a table ? I've had good luck with the xpath support in PG[1] and some variant of the "unnest" function that's in PG 8.4 (various versions[2] have been p

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Ries van Twisk
On May 6, 2009, at 4:16 PM, Eric Schwarzenbach wrote: Gauthier, Dave wrote: Is there a way to read an XML file into a postgres DB? I’m thinking that it will create and relate whatever tables are necessary to reflect whatever’s implied by the XML file structure. Thanks for any pointers !

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread John R Pierce
Gauthier, Dave wrote: Is there a way to read an XML file into a postgres DB? I’m thinking that it will create and relate whatever tables are necessary to reflect whatever’s implied by the XML file structure. Thanks for any pointers ! As others have said, the fundamental problem is that ge

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Eric Schwarzenbach
Gauthier, Dave wrote: > > Is there a way to read an XML file into a postgres DB? I’m thinking > that it will create and relate whatever tables are necessary to > reflect whatever’s implied by the XML file structure. > > > > Thanks for any pointers ! > That's a pretty common problem, and not one

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Joao Ferreira
On Wed, 2009-05-06 at 16:53 +0100, Joao Ferreira gmail wrote: > hello, > > as a perl addict I am... I recommend checking this out: > > http://search.cpan.org/~cmungall/DBIx-DBStag/DBIx/DBStag/Cookbook.pm > > it's pretty flexible and allows you to specify to some extent just how > the database st

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Thomas Kellerer
Gauthier, Dave, 06.05.2009 17:40: Maybe... EMP EMP_NAME="FRANK" JOB="PLUMBER"/> EMP EMP_NAME="SUE" JOB="CARPENTER"/> ...equals... create table employees (emp_name varchar[64], job varchar[64]); create table jobs (job_name varchar[64], salary float); insert

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Joao Ferreira gmail
On Wed, 2009-05-06 at 16:53 +0100, Joao Ferreira gmail wrote: > hello, > > as a perl addict I am... I recommend checking this out: > > http://search.cpan.org/~cmungall/DBIx-DBStag/DBIx/DBStag/Cookbook.pm > > it's pretty flexible and allows you to specify to some extent just how > the database st

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Joao Ferreira gmail
hello, as a perl addict I am... I recommend checking this out: http://search.cpan.org/~cmungall/DBIx-DBStag/DBIx/DBStag/Cookbook.pm it's pretty flexible and allows you to specify to some extent just how the database structure is infered from the XML... check it out Joao On Wed, 2009-05-06

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Gauthier, Dave
("CARPENTER",25.50); insert into jobs (job_name,salary) values ("PLUMBER",28.75); After that, it's up to the user to understand that employees.job = jobs.job_name and index appropriately. -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Se

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Christophe
On May 6, 2009, at 10:47 AM, Gauthier, Dave wrote: Is there a way to read an XML file into a postgres DB? I’m thinking that it will create and relate whatever tables are necessary to reflect whatever’s implied by the XML file structure. There's no built-in functionality that does what you

Re: [GENERAL] XML -> PG ?

2009-05-06 Thread Merlin Moncure
On Wed, May 6, 2009 at 10:47 AM, Gauthier, Dave wrote: > Is there a way to read an XML file into a postgres DB?  I’m thinking that it > will create and relate whatever tables are necessary to reflect whatever’s > implied by the XML file structure. since xml is basically completely unstructured, y

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Peter Eisentraut
Jef Peeraer wrote: it would be a flag to indicate no conversion from the datestyle settings in the database...i think, from a users perspective, the table_to_xml is completely useless, if you have to reformat everything afterwards Just write a function that does your formatting afterwards.

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Pavel Stehule
2008/9/11 Jef Peeraer <[EMAIL PROTECTED]>: > > > On Thu, 11 Sep 2008, Peter Eisentraut wrote: > >> Jef Peeraer wrote: >> > >> > On Thu, 11 Sep 2008, Peter Eisentraut wrote: >> > >> > > Tom Lane wrote: >> > > > Jef Peeraer <[EMAIL PROTECTED]> writes: >> > > > > i am using the xml add-ons, but the da

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Jef Peeraer
On Thu, 11 Sep 2008, Peter Eisentraut wrote: > Jef Peeraer wrote: > > > > On Thu, 11 Sep 2008, Peter Eisentraut wrote: > > > > > Tom Lane wrote: > > > > Jef Peeraer <[EMAIL PROTECTED]> writes: > > > > > i am using the xml add-ons, but the date output format seems to be > > > > > wrong : > > >

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Peter Eisentraut
Jef Peeraer wrote: On Thu, 11 Sep 2008, Peter Eisentraut wrote: Tom Lane wrote: Jef Peeraer <[EMAIL PROTECTED]> writes: i am using the xml add-ons, but the date output format seems to be wrong : I think the conversion to xml intentionally always uses ISO date format, because that's required

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Pavel Stehule
2008/9/11 Jef Peeraer <[EMAIL PROTECTED]>: > > > On Thu, 11 Sep 2008, Peter Eisentraut wrote: > >> Tom Lane wrote: >> > Jef Peeraer <[EMAIL PROTECTED]> writes: >> > > i am using the xml add-ons, but the date output format seems to be wrong >> > > : >> > >> > I think the conversion to xml intention

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Jef Peeraer
On Thu, 11 Sep 2008, Peter Eisentraut wrote: > Tom Lane wrote: > > Jef Peeraer <[EMAIL PROTECTED]> writes: > > > i am using the xml add-ons, but the date output format seems to be wrong : > > > > I think the conversion to xml intentionally always uses ISO date format, > > because that's require

Re: [GENERAL] xml queries & date format

2008-09-11 Thread Peter Eisentraut
Tom Lane wrote: Jef Peeraer <[EMAIL PROTECTED]> writes: i am using the xml add-ons, but the date output format seems to be wrong : I think the conversion to xml intentionally always uses ISO date format, because that's required by some spec somewhere. Yes, it follows XML Schema. Which is wh

Re: [GENERAL] xml queries & date format

2008-09-05 Thread Tom Lane
Jef Peeraer <[EMAIL PROTECTED]> writes: > i am using the xml add-ons, but the date output format seems to be wrong : I think the conversion to xml intentionally always uses ISO date format, because that's required by some spec somewhere. regards, tom lane -- Sent via pgs

Re: [GENERAL] xml and postgresql

2008-07-04 Thread William Leite Araújo
On Fri, Jul 4, 2008 at 11:01 AM, Gwyneth Morrison <[EMAIL PROTECTED]> wrote: > aravind chandu wrote: > > Hi folks, > > I need to load xml data in to database can you tell me they > way how do I import xml data into postgresql database. > > lets dat this is the xml file > > > > >

Re: [GENERAL] xml and postgresql

2008-07-04 Thread Gwyneth Morrison
aravind chandu wrote: Hi folks, I need to load xml data in to database can you tell me they way how do I import xml data into postgresql database. lets dat this is the xml file Harry Potter J K. Rowling 2005 29

Re: [GENERAL] XML output & multiple SELECT queries

2008-06-15 Thread Peter Eisentraut
Peter Billen wrote: > I would like to ask a question about outputting data as XML. Say I have two > tables: > > team(integer id, text name); > player_of_team(integer id, integer team_id, text name); (team_id is FK to > team.id) > > I would like to query both tables to get following example XML outp

Re: [GENERAL] XML Support related questions

2008-05-27 Thread Peter Eisentraut
Brijesh Shrivastav wrote: > For #4 I was looking to be able to index some or all of the tags in the > xml document. Most of our applications query very few tags in a Xml > document > and a smaller index on few tags will help with query performance. Expression indexes on xpath are probably what you

Re: [GENERAL] XML Support related questions

2008-05-24 Thread Peter Eisentraut
Am Donnerstag, 22. Mai 2008 schrieb Brijesh Shrivastav: > 1) Can xml column be constrained to be DOCUMENT or CONTENT type? Using a check constraint that does IS [NOT] DOCUMENT on the value. > 2) Is there plan in near future to support XML schema validation > i.e to ensure inserted xml d

Re: [GENERAL] XML Support related questions

2008-05-23 Thread Craig Ringer
Brijesh Shrivastav wrote: 1) Can xml column be constrained to be DOCUMENT or CONTENT type? XMLPARSE/XMLSERIALIZE functions allows to set XML option DOCUMENT or CONTENT type. Can we do the same when defining an xml column level? Maybe this could be done with a PL trigger ? Ideally you'd d

Re: [GENERAL] XML Support related questions

2008-05-23 Thread Stephane Bortzmeyer
On Thu, May 22, 2008 at 11:49:38AM -0700, Brijesh Shrivastav <[EMAIL PROTECTED]> wrote a message of 251 lines which said: > 2) Is there plan in near future to support XML schema validation i.e > to ensure inserted xml document conforms to a preregistered set of > XML schemas. It seems quite he

Re: [GENERAL] XML-support

2008-01-30 Thread Peter Eisentraut
Sigurd Nes wrote: > I noticed the upcoming support for xml in 8.3: > Does anybody know if this allows updates, inserts,removes and renames of > nodes to a XML-document (as for Xindice)? No, it doesn't support that directly. I guess you could achieve it by using XSLT. -- Peter Eisentraut http:/

Re: [GENERAL] XML path function

2008-01-09 Thread x asasaxax
Can you tell me, in how much time did the query will take with indexes + tsearch2? How much time take a satisfactory query? Can you show me some examples with tsearch2 and xml indexes? Thanks

Re: [GENERAL] XML path function

2008-01-09 Thread Nikolay Samokhvalov
On Jan 9, 2008 6:00 PM, x asasaxax <[EMAIL PROTECTED]> wrote: > My Postgre version its the 8.2. I´ve reached to do the path i wanted, but > when i do a explain analyze on the select it return 500 miliseconds. Is this > a good search? Is there a way to slow down this time with postgre 8.3? What > is

Re: [GENERAL] XML path function

2008-01-09 Thread x asasaxax
My Postgre version its the 8.2. I´ve reached to do the path i wanted, but when i do a explain analyze on the select it return 500 miliseconds. Is this a good search? Is there a way to slow down this time with postgre 8.3? What is a good time for xml xpath´s? Thanks 2008/1/8, x asasaxax <[EMAIL PR

Re: [GENERAL] XML path function

2008-01-08 Thread Nikolay Samokhvalov
On Jan 8, 2008 11:21 PM, x asasaxax <[EMAIL PROTECTED]> wrote: > Hi everyone, > >I´m trying to undestand how to do select with xml path. First of all, what is your Postgres version? 8.3 with xml support or older one with conrib/xml2? In case of 8.3, you can find some examples in current docs:

Re: [GENERAL] XML and Routing

2008-01-08 Thread David Fetter
On Tue, Jan 08, 2008 at 06:06:43PM +, William Temperley wrote: > Hi > > Does anyone know if there is an 8.2.X windows build that has xml > support, including the XML datatype and SQL/XML functions such as > xmlagg and xmlelement? No, and there won't be in the future. We don't add features af

Re: [GENERAL] XML schema

2007-11-16 Thread Sean Davis
On Nov 16, 2007 2:14 PM, Peter Eisentraut <[EMAIL PROTECTED]> wrote: > Sean Davis wrote: > > I meant a schema that > > represents a general mapping between XML and a relational schema. In > > other words, I am looking for tools that use postgresql as the storage > > engine for a native XML database

Re: [GENERAL] XML schema

2007-11-16 Thread Sean Davis
On Nov 15, 2007 6:20 PM, Peter Eisentraut <[EMAIL PROTECTED]> wrote: > Sean Davis wrote: > > Is the current XML datatype (in 8.3) the direction of the > > future, or is something more akin to a dedicated XML schema (I think > > this is the route that Oracle has gone) going to be important? > > An X

Re: [GENERAL] XML schema

2007-11-16 Thread Peter Eisentraut
Sean Davis wrote: > I meant a schema that > represents a general mapping between XML and a relational schema.  In > other words, I am looking for tools that use postgresql as the storage > engine for a native XML database. There are ideas for that, but nothing to be expected any time soon. -- Pe

Re: [GENERAL] XML schema

2007-11-15 Thread Peter Eisentraut
Sean Davis wrote: > Is the current XML datatype (in 8.3) the direction of the > future, or is something more akin to a dedicated XML schema (I think > this is the route that Oracle has gone) going to be important? An XML schema is a specification that describes required properties of an XML docum

Re: [GENERAL] xml to db converter

2007-05-12 Thread Jerry
On May 10, 6:02 pm, [EMAIL PROTECTED] (garry saddington) wrote: > Does anyone know of a tool that will generate a postgres database schema > given an xml schema(xsd). Have triedxmlspywhich says it does so but it > only has limited postgres support and then it crashes. > regards > Garry > >

Re: [GENERAL] XML Support

2006-06-22 Thread Stephane Bortzmeyer
On Tue, Jun 20, 2006 at 02:17:28PM +0100, Essam Mansour <[EMAIL PROTECTED]> wrote a message of 35 lines which said: > In my research project, I need a DBMS that supports XML storage and > retrieval, and provides ECA rule support. (No idea about ECA.) > - whether Postgresql DB could be used as

Re: [GENERAL] XML Support

2006-05-26 Thread Thomas Kellerer
John Gray wrote on 26.05.2006 22:01: I can't claim to have great Windows compilation skills, but another contributor posted a zipped dll some time ago: http://archives.postgresql.org/pgsql-novice/2005-11/msg00216.php That may help you out. Thanks for the pointer, but I can't seem to get that

Re: [GENERAL] XML Support

2006-05-26 Thread John Gray
On Fri, 26 May 2006 13:25:34 +0200, Thomas Kellerer wrote: > Hello, > > I'm trying to use XML with PG, and I a descriptioin of the XML support for > PostgreSQL at http://www.throwingbeans.org/postgresql_and_xml_updated.html > > As I could not find the mentioned package in my Windows installation

Re: [GENERAL] xml output

2006-03-22 Thread David Fetter
On Mon, Mar 20, 2006 at 06:22:32PM -0600, Murali K. Maddali wrote: > Hello Guys, > > I am trying to export the data out of the database directly to an > xml file. Is there a way that I could this in PostgreSQL. You could use the libxml2 bindings in contrib/ and pipe that output to a file. Cheers

Re: [GENERAL] xml output

2006-03-22 Thread Jim C. Nasby
On Mon, Mar 20, 2006 at 06:22:32PM -0600, Murali K. Maddali wrote: > Hello Guys, > > I am trying to export the data out of the database directly to an xml > file. Is there a way that I could this in PostgreSQL. Not automatically. You'll need to build the XML by hand, or by using something like p

Re: [GENERAL] xml output.

2006-03-20 Thread Murali K. Maddali
I was trying to write out data from a table to an xml file, so that I could export out this file to another external application from another vendor. I got to export the data based on a predefined schema. I am able to do this through .NET using c#, but I was wondering if there is way if I can d

Re: [GENERAL] xml output.

2006-03-20 Thread Chris
Murali K. Maddali wrote: Can I use pl/pgsql or pl/tcl to write function to do that. Can't see why not (I'm sure others will chime in if it's not possible or not a good idea) but that's not going to help for a full database dump. Doing a set of results it should work ok though. Depends what yo

Re: [GENERAL] xml output.

2006-03-20 Thread Murali K. Maddali
Can I use pl/pgsql or pl/tcl to write function to do that. Murali. Chris wrote: Murali K. Maddali wrote: Hello Guys, I am trying to export the data out of the database directly to an xml file. Is there a way that I could do this in PostgreSQL. I am looking for a function or something like t

Re: [GENERAL] xml output.

2006-03-20 Thread Chris
Murali K. Maddali wrote: Hello Guys, I am trying to export the data out of the database directly to an xml file. Is there a way that I could do this in PostgreSQL. I am looking for a function or something like that. Does PostgreSQL support sqlxml. Don't think so. A small script (perl, python

Re: [GENERAL] xml and utf-8

2006-03-04 Thread Gavin M. Roy
If your DB encoding is UTF-8, I don't see why you can't use a TEXT data type. Regards, Gavin On Mar 2, 2006, at 7:07 PM, Perez wrote: Any pointers/tricks/gotchas on storing XML into postgresql? Is it any more complicated than storing the XML into a bytea field? Do I have to worry about

Re: [GENERAL] xml export tool?

2006-01-11 Thread Qingqing Zhou
"JJC" <[EMAIL PROTECTED]> wrote > > I'm looking for an open-source tool that will allow me to extract data as > XML. > If you want to extract data from PostgreSQL, I think most XML export tool will do if they can connect to database via ODBC/JDBC. Regards, Qingqing --

  1   2   >