Re: Array of foreign key

2017-12-23 Thread Daevor The Devoted
On 23 Dec 2017 9:54 pm, "Thomas Poty" wrote: Good evening all, I have just see all the messages. Thanks for that. First, Peter Holzer has exactly understooden my need. I am à bit disappointed this feature is not implemented. It would be great. Then, I know enum is probably not the best choice b

Re: Migrating to postgresql from oracle

2017-12-23 Thread Timo Myyrä
On Sat, Dec 23, 2017, at 21:05, Pavel Stehule wrote: > Hi > > 2017-12-23 19:53 GMT+01:00 Timo Myyrä : >> Hi, >> >> I'm preparing migration of our asset management system database from >> Oracle 12c to>> PostgreSQL 10. I'm using ora2pg and a bit of sed to >> mangle the SQL >> ready for>> im

Re: Array of foreign key

2017-12-23 Thread Thomas Poty
Good evening all, I have just see all the messages. Thanks for that. First, Peter Holzer has exactly understooden my need. I am à bit disappointed this feature is not implemented. It would be great. Then, I know enum is probably not the best choice but it is historic in our database. Like I said

Re: Array of foreign key

2017-12-23 Thread Melvin Davidson
On Sat, Dec 23, 2017 at 2:27 PM, Peter J. Holzer wrote: > On 2017-12-23 13:14:50 -0500, Melvin Davidson wrote: > > On Sat, Dec 23, 2017 at 12:49 PM, Ken Tanzer > wrote: > > > > I thought the OP was asking for this feature ("Support for Array > ELEMENT > > Foreign Keys"): > > > > http

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
On 2017-12-23 13:14:50 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 12:49 PM, Ken Tanzer wrote: > > I thought the OP was asking for this feature ("Support for Array ELEMENT > Foreign Keys"): > > https://www.postgresql.org/message-id/flat/1343842863. > 5162.4.ca...@grey

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
On 2017-12-23 12:24:07 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 12:09 PM, Peter J. Holzer wrote: > >...Is there a way to > >enforce foreign key constraints on the members of an array? > >At insert time you can check with a trigger of course, and maybe there > >is a way to do it in a

Group Roles with Inheritance

2017-12-23 Thread Igal @ Lucee.org
Hello, I want to create three (group) roles.  The first one will be read-only, the second will add INSERT, and the third will add UPDATE and DELETE. Does the below look OK for this purpose or did I forget something? /** role_r is read-only with SELECT and EXECUTE */ CREATE ROLE role_r; GRAN

Re: Migrating to postgresql from oracle

2017-12-23 Thread Pavel Stehule
Hi 2017-12-23 19:53 GMT+01:00 Timo Myyrä : > Hi, > > I'm preparing migration of our asset management system database from > Oracle 12c to > PostgreSQL 10. I'm using ora2pg and a bit of sed to mangle the SQL ready > for > import to pg but I've hit first problem: > ERROR: referenced relation "..."

Migrating to postgresql from oracle

2017-12-23 Thread Timo Myyrä
Hi, I'm preparing migration of our asset management system database from Oracle 12c to PostgreSQL 10. I'm using ora2pg and a bit of sed to mangle the SQL ready for import to pg but I've hit first problem: ERROR: referenced relation "..." is not a table Our Oracle databases uses single 'admin' s

Re: Array of foreign key

2017-12-23 Thread Melvin Davidson
On Sat, Dec 23, 2017 at 12:49 PM, Ken Tanzer wrote: > >> I don't think you understand how Foreign Key constraints work in >> PostgreSQL. >> PostgreSQL will prevent any insert where the value of a column is not >> within the FK table. >> So you DO NOT need a check constraint or trigger. >> >> > I

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeremy Finzel
> > The only thing I can think of is that there's a foreign key from foo to > bar(id), but the create index on bar shouldn't prevent a share lock on > foo, even if such a restriction exists. > > -- > Martín Marquéshttp://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, T

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeremy Finzel
> > >> Each index build needs to wait for all other transactions (Including the > ones used by the other index build) to finish. So I don't think a deadlock > here is unexpected. > > Cheers, > > Jeff > Does that mean I should never build more than one concurrent index at a time within the entire

Re: Array of foreign key

2017-12-23 Thread Ken Tanzer
> > > I don't think you understand how Foreign Key constraints work in > PostgreSQL. > PostgreSQL will prevent any insert where the value of a column is not > within the FK table. > So you DO NOT need a check constraint or trigger. > > I thought the OP was asking for this feature ("Support for Arra

Re: Array of foreign key

2017-12-23 Thread Melvin Davidson
On Sat, Dec 23, 2017 at 12:09 PM, Peter J. Holzer wrote: > On 2017-12-22 22:05:18 +0100, Andreas Kretschmer wrote: > > > > >Please DO NOT use EMUMs. That is old. They are hard to maintain. I > > >also know from experience that MySql does not check integrity of > > >enums. It's possible you can ha

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
On 2017-12-22 22:05:18 +0100, Andreas Kretschmer wrote: > > >Please DO NOT use EMUMs. That is old. They are hard to maintain. I > >also know from experience that MySql does not check integrity of > >enums. It's possible you can have data in a MySql table column that > >is not valid for current enu

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Jeff Janes
On Fri, Dec 22, 2017 at 1:53 PM, Jeremy Finzel wrote: > I am attempting to build several indexes in parallel, guaranteeing that I > never build one on the same table twice. I understand I can't build two on > the same table at once or I will get a deadlock. However, I am also > getting a deadlo

Re: Stand by server (9.6.6) with corrupt file

2017-12-23 Thread Martin Marques
El 22/12/17 a las 10:29, Edson Carlos Ericksson Richter escribió: > Environment: PostgreSQL 9.6.6 installed from yum repository. Oracle > Linux 7 EL x64. Dell servers with Raid 5 (hw). > > > I was testing our database backup system (based on pgBarman), and > discovered that one base file is corru

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Martin Marques
El 22/12/17 a las 18:53, Jeremy Finzel escribió: > I am attempting to build several indexes in parallel, guaranteeing that > I never build one on the same table twice.  I understand I can't build > two on the same table at once or I will get a deadlock.  However, I am > also getting a deadlock when

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Martin Marques
El 23/12/17 a las 08:08, Alban Hertroys escribió: > >> On 22 Dec 2017, at 22:53, Jeremy Finzel wrote: >> >> 2017-12-22 15:48:07.669 CST,"CREATE INDEX",2017-12-22 15:48:02 >> CST,8/32,0,ERROR,40P01,"deadlock detected","Process 4470 waits for ShareLock >> on virtual transaction 4/262; blocked by

Re: Deadlock between concurrent index builds on different tables

2017-12-23 Thread Alban Hertroys
> On 22 Dec 2017, at 22:53, Jeremy Finzel wrote: > > 2017-12-22 15:48:07.669 CST,"CREATE INDEX",2017-12-22 15:48:02 > CST,8/32,0,ERROR,40P01,"deadlock detected","Process 4470 waits for ShareLock > on virtual transaction 4/262; blocked by process 4466. > Process 4466 waits for ShareLock on virt