Thread: How do I implement a .XSD in Postgres?

How do I implement a .XSD in Postgres?

From
ERR ORR
Date:
Hi everybody,

I need to import some DB schemas which are defined in .XSD (a XML derivative) format.
I've googled about this but have found no satisfactory answer. Perhaps I just don't know what exactly to ask Google.

So please:
- What tool can I use in order to import .XSD schema definitions into Postgresql 9.4.5?
- If there is no tool, can you please direct me to a document at least hinting at how to import a .XSD schema into a DB?

Thanks and happy new year to all.

Re: How do I implement a .XSD in Postgres?

From
Adrian Klaver
Date:
On 01/01/2016 02:07 AM, ERR ORR wrote:
> Hi everybody,
>
> I need to import some DB schemas which are defined in .XSD (a XML
> derivative) format.
> I've googled about this but have found no satisfactory answer. Perhaps I
> just don't know what exactly to ask Google.
>
> So please:
> - What tool can I use in order to import .XSD schema definitions into
> Postgresql 9.4.5?

Whatever tool that generated them in the first place?

Some background on what/who generated the files would be useful.


> - If there is no tool, can you please direct me to a document at least
> hinting at how to import a .XSD schema into a DB?

Not sure if in the above you are talking about importing the actual
XSD(XML) files into a database field or walking through the files and
generating database objects from them?

>
> Thanks and happy new year to all.


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: How do I implement a .XSD in Postgres?

From
"David G. Johnston"
Date:
On Fri, Jan 1, 2016 at 3:07 AM, ERR ORR <rd0002@gmail.com> wrote:
Hi everybody,

I need to import some DB schemas which are defined in .XSD (a XML derivative) format.
I've googled about this but have found no satisfactory answer. Perhaps I just don't know what exactly to ask Google.

So please:
- What tool can I use in order to import .XSD schema definitions into Postgresql 9.4.5?
- If there is no tool, can you please direct me to a document at least hinting at how to import a .XSD schema into a DB?

Thanks and happy new year to all.

​So, you are basically looking for an XSD to SQL converter, potentially with knowledge of PostgreSQL implementation specifics​.  No clue - though like Adrian said the source of the XSD file would ideally have meaningful knowledge of how to actually use it.

David J.

Re: How do I implement a .XSD in Postgres?

From
Thomas Kellerer
Date:
ERR ORR schrieb am 01.01.2016 um 11:07:
> I need to import some DB schemas which are defined in .XSD (a XML derivative) format.
> I've googled about this but have found no satisfactory answer. Perhaps I just don't know what exactly to ask Google.
>
> So please:
> - What tool can I use in order to import .XSD schema definitions into Postgresql 9.4.5?
> - If there is no tool, can you please direct me to a document at least hinting at how to import a .XSD schema into a
DB?
>

If indeed you just want to convert the XSD to a SQL script (that contains the approriate CREATE TABLE statements),
then this can be done using XSLT as an XSD is just XML after all.




Re: How do I implement a .XSD in Postgres?

From
"Charles Clavadetscher"
Date:

Hello

 

XML is an extensible object description language and XSD is not an XML derivative, but an implementation of the XML extensibility as a replacement for DTD. It is finally nothing else than an XML file following the validation schema of itself (http://www.w3.org/2001/XMLSchema). Being XML you can load it into an XML field in PostgreSQL just like any other XML document (e.g. xml, wsdl, xslt, soap, etc.).

 

You can find a possible way on how to do it here: http://www.schmiedewerkstatt.ch/wiki/index.php/PostgreSQL:_Writing_text,_xml_content_into_a_field

 

Bye

Charles

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of David G. Johnston
Sent: Freitag, 1. Januar 2016 19:02
To: ERR ORR <rd0002@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] How do I implement a .XSD in Postgres?

 

On Fri, Jan 1, 2016 at 3:07 AM, ERR ORR <rd0002@gmail.com> wrote:

Hi everybody,

I need to import some DB schemas which are defined in .XSD (a XML derivative) format.

I've googled about this but have found no satisfactory answer. Perhaps I just don't know what exactly to ask Google.

So please:

- What tool can I use in order to import .XSD schema definitions into Postgresql 9.4.5?

- If there is no tool, can you please direct me to a document at least hinting at how to import a .XSD schema into a DB?

Thanks and happy new year to all.

 

​So, you are basically looking for an XSD to SQL converter, potentially with knowledge of PostgreSQL implementation specifics​.  No clue - though like Adrian said the source of the XSD file would ideally have meaningful knowledge of how to actually use it.

 

David J.

 

Re: How do I implement a .XSD in Postgres?

From
Brar Piening
Date:
ERR ORR schrieb:
> Hi everybody,
>
> I need to import some DB schemas which are defined in .XSD (a XML
> derivative) format.
> I've googled about this but have found no satisfactory answer. Perhaps I
> just don't know what exactly to ask Google.

Perhaps you are talking about the xsd definition of strongly typed datasets?
https://msdn.microsoft.com/en-us/library/esbykkzb(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/84sxtbxh(v=vs.110).aspx

Those can be used to create a Dataset in .Net which is something like an
in-memory representation of a database but are not intended to be the
source of a database schema.
https://msdn.microsoft.com/en-us/library/zb0sdh0b(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/3b4194wc(v=vs.110).aspx


>
> So please:
> - What tool can I use in order to import .XSD schema definitions into
> Postgresql 9.4.5?
> - If there is no tool, can you please direct me to a document at least
> hinting at how to import a .XSD schema into a DB?

If my guess was correct, there might be tools out there but as I stated
this is not what these files are usually made for.

http://xsd2db.sourceforge.net/


>
> Thanks and happy new year to all.


Re: How do I implement a .XSD in Postgres?

From
Marc Munro
Date:
On Sat, 2016-01-02 at 00:20 +0000, ERR ORR wrote:

> I need to import some DB schemas which are defined in .XSD (a XML
> derivative) format.
> I've googled about this but have found no satisfactory answer. Perhaps
> I
> just don't know what exactly to ask Google.
>
> So please:
> - What tool can I use in order to import .XSD schema definitions into
> Postgresql 9.4.5?
> - If there is no tool, can you please direct me to a document at least
> hinting at how to import a .XSD schema into a DB?
>
> Thanks and happy new year to all.

If I understand your requirement, you have a database definition in an
xml dialect, and you want to convert that into a database.

If you can convert the xml dialect using xslt or something similar, you
can use skit (http://pgfoundry.org/projects/skit/ )to convert the
resulting xml into ddl which can then be run using psql.

Unfortunately, I have not gotten around to documenting the xml schema
for skit, but if you run the regression tests you should be able to get
enough examples to figure it out.

If you want to give this a try, you can email me off list and I'll do
what I can to help.

__
Marc