[GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-01 Thread Dane Foster
Hello, I'm moving a MySQL database to PostgreSQL and redesigning parts of it to take advantage of PostgreSQL's richer type system and other advance features. Currently I am attempting to replace a table of name/value pair data w/ a hstore column. But now that the data will no longer be flattened

[GENERAL] Efficiently selecting single row from a select with window functions row_number, lag and lead

2016-01-01 Thread Andrew Bailey
I would like to do the following: select id, row_number() over w as rownum, lag(id, 1) over w as prev, lead(id, 1) over w as next from route where id=1350 window w as (order by shortname, id asc rows between 1 preceding and 1 following) order by shortname, id ; However this gives the result

[GENERAL] How do I implement a .XSD in Postgres?

2016-01-01 Thread ERR ORR
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

Re: [GENERAL] to_timestamp alternatives

2016-01-01 Thread Thomas Kellerer
gkhan schrieb am 31.12.2015 um 22:34: Thanks very much for both of your replies. I had tried something similar and gotten an error, so I am probably making a stupid mistake. If I try this, it works: SELECT ('09.03.2014'||' '||lpad('3:00:00',8,'0'),'DD.MM. HH24:MI:SS')::timestamp but

Re: [GENERAL] to_timestamp alternatives

2016-01-01 Thread Alban Hertroys
> On 01 Jan 2016, at 0:46, Jim Nasby wrote: > > BTW, my recommendation would be to store in a timestamptz field *with the > correct timezone*, and then convert on output as necessary. This is easy to > do by either > > SET timezone > > or > > SELECT

Re: [GENERAL] Happy New Year

2016-01-01 Thread Melvin Davidson
Happy New Year to all! On Fri, Jan 1, 2016 at 2:40 AM, Michael Paquier wrote: > On Fri, Jan 1, 2016 at 11:36 AM, Joshua D. Drake > wrote: > > Welcome to 2016. > > > > Let's have another bang up year! > > +1. > -- > Michael > > > -- > Sent via

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

2016-01-01 Thread Charles Clavadetscher
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 (

Re: [GENERAL] Happy New Year

2016-01-01 Thread Dorian Hoxha
Happy Holidays! Let's have automatic sharding and distributed transactions! On Fri, Jan 1, 2016 at 3:51 PM, Melvin Davidson wrote: > Happy New Year to all! > > On Fri, Jan 1, 2016 at 2:40 AM, Michael Paquier > wrote: > >> On Fri, Jan 1, 2016

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

2016-01-01 Thread David G. Johnston
On Fri, Jan 1, 2016 at 3: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. >

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

2016-01-01 Thread Thomas Kellerer
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

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

2016-01-01 Thread Adrian Klaver
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