Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread Berend Tober
Chris Hoover wrote:> Correct sql: > BEGIN; > > CREATE TABLE table1 ( >table1_id SERIAL PRIMARY KEY, >table1_field1 TEXT > ); > > CREATE TABLE table2 ( >table1_id INTEGER NOT NULL PRIMARY KEY REFERENCES table1(table1_id) > ON DELETE CASCADE, >table2_field1 TEXT > ); > > CREATE VIEW

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread David G Johnston
On Tue, Dec 23, 2014 at 6:40 PM, rob stone-2 [via PostgreSQL] < ml-node+s1045698n583190...@n5.nabble.com> wrote: > Rather strange to have two tables sharing the same primary key value. > One would have thought it was a one-to-many relationship between table1 > and table2. > > ​while not particular

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread rob stone
On Tue, 2014-12-23 at 15:00 -0500, Chris Hoover wrote: > Sorry, in my haste to get the example out, a couple of typo's where in > the sql. > > > Correct sql: > BEGIN; > > > CREATE TABLE table1 ( > > table1_id SERIAL PRIMARY KEY, > table1_field1 TEXT > ); > > > CREATE TABLE table2 ( >

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread David G Johnston
David G Johnston wrote > > Chris Hoover-2 wrote >> Sorry, in my haste to get the example out, a couple of typo's where in >> the >> sql. > Next time, don't quote the entire original wrong query... > > Anyway, you probably want to create a trigger on your view and do the > inserts inside the trigg

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread David G Johnston
Chris Hoover-2 wrote > Sorry, in my haste to get the example out, a couple of typo's where in the > sql. Next time, don't quote the entire original wrong query... Anyway, you probably want to create a trigger on your view and do the inserts inside the trigger function. User created CREATE RULE i

Re: [GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread Chris Hoover
Sorry, in my haste to get the example out, a couple of typo's where in the sql. Correct sql: BEGIN; CREATE TABLE table1 ( table1_id SERIAL PRIMARY KEY, table1_field1 TEXT ); CREATE TABLE table2 ( table1_id INTEGER NOT NULL PRIMARY KEY REFERENCES table1(table1_id) ON DELETE CASCADE, table

[GENERAL] How to insert into 2 tables from a view?

2014-12-23 Thread Chris Hoover
Hi, I am having a problem trying to figure out. I have two tables behind a view and am trying to figure out how to create the correct insert rule so that inserting into the view is redirected to the two tables. I thought I had is solved using a stored procedure, but doing an insert into view ...

Re: [GENERAL] Check if LDAP Authentication is used for user

2014-12-23 Thread pinker
thank you for the answer. -- View this message in context: http://postgresql.nabble.com/Check-if-LDAP-Authentication-is-used-for-user-tp5831817p5831847.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgresq

Re: [GENERAL] Check if LDAP Authentication is used for user

2014-12-23 Thread Tom Lane
pinker writes: > Is there any way to check from SQL or psql level if for roles LDAP > Authentication is used? There is no information in pg_roles or pg_shadow. Nope, sorry. That's determined by pg_hba.conf, which is intentionally not exposed to clients (and wouldn't necessarily make the determin

[GENERAL] Check if LDAP Authentication is used for user

2014-12-23 Thread pinker
Is there any way to check from SQL or psql level if for roles LDAP Authentication is used? There is no information in pg_roles or pg_shadow. -- View this message in context: http://postgresql.nabble.com/Check-if-LDAP-Authentication-is-used-for-user-tp5831817.html Sent from the PostgreSQL - gene

Re: [GENERAL] mysql with postgres

2014-12-23 Thread John McKown
On Tue, Dec 23, 2014 at 3:37 AM, Ravi Kiran wrote: > hi all, > > > Is postgres source code compatible with mysql database?? If it is, could > someone could give me some links so that I can do that. > > I want to hack into the postgres source code, but as I am comfortable with > mysql, I want to u

Re: [GENERAL] mysql with postgres

2014-12-23 Thread John R Pierce
On 12/23/2014 1:37 AM, Ravi Kiran wrote: Is postgres source code compatible with mysql database?? If it is, could someone could give me some links so that I can do that. I want to hack into the postgres source code, but as I am comfortable with mysql, I want to use the mysql database not po

Re: [GENERAL] BDR conpilation error un Ubuntu 12.4 LTS

2014-12-23 Thread stefano bonnin
Hi Giuseppe, adding: git checkout bdr-pg/REL9_4_STABLE it works! Thanks! Best regards 2014-12-23 9:59 GMT+01:00 Giuseppe Broccolo < giuseppe.brocc...@2ndquadrant.it>: > > Hi Stefano, > > I used the same version of gcc (Ubuntu/Linaro 4.6.3-1ubuntu5), and I > followed your steps compiling withou

[GENERAL] mysql with postgres

2014-12-23 Thread Ravi Kiran
hi all, Is postgres source code compatible with mysql database?? If it is, could someone could give me some links so that I can do that. I want to hack into the postgres source code, but as I am comfortable with mysql, I want to use the mysql database not postgres. any references would be fine.

Re: [GENERAL] BDR conpilation error un Ubuntu 12.4 LTS

2014-12-23 Thread Giuseppe Broccolo
Hi Stefano, I used the same version of gcc (Ubuntu/Linaro 4.6.3-1ubuntu5), and I followed your steps compiling without problems. I also considered the same git branch (bdr/0.7.1) as in your case. Taking a look to the error you obtained it sounds like an error due to the code, regardless of the use