Re: [GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-02 Thread Dane Foster
On Sat, Jan 2, 2016 at 12:19 PM, Adrian Klaver wrote: > On 01/02/2016 08:13 AM, Dane Foster wrote: > > Ccing list. > >> On Sat, Jan 2, 2016 at 10:30 AM, Adrian Klaver >> mailto:adrian.kla...@aklaver.com>> wrote: >> >> On 01/01/2016 07:47 PM, Dane Foster wrote: >> >> Hello, >> >>

Re: [GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-02 Thread Adrian Klaver
On 01/02/2016 08:13 AM, Dane Foster wrote: Ccing list. On Sat, Jan 2, 2016 at 10:30 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 01/01/2016 07:47 PM, Dane Foster wrote: Hello, I'm moving a MySQL database to PostgreSQL and redesigning parts of it t

Re: [GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-02 Thread Dane Foster
On Sat, Jan 2, 2016 at 10:59 AM, Bill Moran wrote: > On Sat, 2 Jan 2016 07:30:38 -0800 > Adrian Klaver wrote: > > > > So given: > > > > > > CREATE TABLE xtra_fields( > > >xfk SERIAL PRIMARY KEY, > > >xtk INTEGER NOT NULL REFERENCES xtra_types, > > >... > > > ); > > > > > > CREATE OR

Re: [GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-02 Thread Bill Moran
On Sat, 2 Jan 2016 07:30:38 -0800 Adrian Klaver wrote: > > So given: > > > > CREATE TABLE xtra_fields( > >xfk SERIAL PRIMARY KEY, > >xtk INTEGER NOT NULL REFERENCES xtra_types, > >... > > ); > > > > CREATE OR REPLACE FUNCTION foo_xtra_fk(HSTORE) RETURNS BOOLEAN AS $$ > > WITH keyz AS

Re: [GENERAL] Enforcing referential integrity against a HSTORE column

2016-01-02 Thread Adrian Klaver
On 01/01/2016 07:47 PM, Dane Foster wrote: 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 no

[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 o