I have a big,big table, this big table is referenced by another tables
by foreign keys.
I have a performance issues so i decide partition it by month ->
...,table_201610,table_201611,table_201612,...
after i have been created the partition tables i try to insert data but
foreign key
Hi,
I agree with each of the points you've made. The idea here is meant as an
extension of what is already available. So yes, this is intended to
answer the questions of the designer's original model. The consideration
being that you design your database and the underlying logic of your
On Fri, 14 Aug 2015 01:14:12 +0100, Adrian Klaver
adrian.kla...@aklaver.com wrote:
On 08/13/2015 05:03 PM, Stephen Feyrer wrote:
Hi,
This is probably not an original question merely one which I haven't
been able to find an answer for.
Basically, the question is why is there not an
On 08/13/2015 05:03 PM, Stephen Feyrer wrote:
Hi,
This is probably not an original question merely one which I haven't
been able to find an answer for.
Basically, the question is why is there not an equivalent foreign key
concept to match the primary key we all already know an love?
How this
On 08/13/2015 05:40 PM, Stephen Feyrer wrote:
On Fri, 14 Aug 2015 01:14:12 +0100, Adrian Klaver
adrian.kla...@aklaver.com wrote:
On 08/13/2015 05:03 PM, Stephen Feyrer wrote:
Hi,
This is probably not an original question merely one which I haven't
been able to find an answer for.
Basically,
Hi,
This is probably not an original question merely one which I haven't been
able to find an answer for.
Basically, the question is why is there not an equivalent foreign key
concept to match the primary key we all already know an love?
How this would work, would be that the foreign key
On Thu, Aug 13, 2015 at 7:26 PM, Stephen Feyrer
stephen.fey...@btinternet.com wrote:
When we design databases, invariably, normally we design the queries at
the same time.
Well this may be true to an extent well implemented models have the
ability to answer questions (queries) the original
On Fri, 14 Aug 2015 01:58:29 +0100, Adrian Klaver
adrian.kla...@aklaver.com wrote:
On 08/13/2015 05:40 PM, Stephen Feyrer wrote:
On Fri, 14 Aug 2015 01:14:12 +0100, Adrian Klaver
adrian.kla...@aklaver.com wrote:
On 08/13/2015 05:03 PM, Stephen Feyrer wrote:
Hi,
This is probably not an
Hello pgsql-general,
I'd like to set up a foreign key constraint to a foreign table from a local
table.
ie, I have a column in a local table that I'd like to ensure has a value in
the foreign table.
alter mytable
add column some_column_id uuid references myforeigntable(some_column_id)
;
Thanks Will!
I had been considering setting up replication (using SymmetricDS - which we
already use between other databases in our environment), but decided for
this one check it was too much trouble. I may change my mind on that point
again after all if I end up with a lot of dependencies like
Rick Otten rottenwindf...@gmail.com writes:
Hello pgsql-general,
I'd like to set up a foreign key constraint to a foreign table from a local
table.
ie, I have a column in a local table that I'd like to ensure has a value in
the foreign table.
alter mytable
add column some_column_id
Hello Rick,
As I understand it you are correct. Oracle/DB2/Postgres and I think the SQL
Standards to not implement constraints against tables on foreign servers.
Although it would be possible to develop the DBMS to handle such
constraints in a heterogeneous distributed environment it would be
Obviously the server will be able to delete those rows because it will be
completely unaware of this dependency.
So it is the implied reverse constraint (of sorts) that can't be enforced
which makes an FK based definition impossible.
For my particular use case, this shouldn't be a problem. The
I have general question about FOREIGN KEYs:
1. Suppose I have table A with primary key X, and another table B with
field Y.
2. When I 'ALTER TABLE B ADD FOREIGN KEY( Y ) REFERENCES A ON
UPDATE CASCADE ON DELETE CASCADE', that clearly spends some time
building a separate index.
On 12/18/2013 11:02 AM, Dean Gibson (DB Administrator) wrote:
I have general question about FOREIGN KEYs:
1. Suppose I have table A with primary key X, and another table B
with field Y.
2. When I 'ALTER TABLE B ADD FOREIGN KEY( Y ) REFERENCES A
ON UPDATE CASCADE ON DELETE
Dean Gibson (DB Administrator) postgre...@ultimeth.com wrote:
I have general question about FOREIGN KEYs:
1. Suppose I have table A with primary key X, and another
table B with field Y.
2. When I 'ALTER TABLE B ADD FOREIGN KEY( Y ) REFERENCES
A ON UPDATE CASCADE ON
On 2013-12-18 10:41, Kevin Grittner wrote:
Dean Gibson (DB Administrator) postgre...@ultimeth.com wrote:
... that clearly spends some time building a separate index.
No it doesn't. If you are observing activity at that time, it is probably from
validating that the constraint is initially
Hello,
I have to define a foreign relation to something like a unique partial
index.
I could do achieve this with triggers, but I already have too much of
them, which make the model hard to understand.
for now, I will just add a constant column which allows to define a
standard foreign key.
On Sun, Dec 4, 2011 at 7:41 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote:
On Sun, Dec 4, 2011 at 7:14 PM, Alban Hertroys haram...@gmail.com wrote:
On 4 Dec 2011, at 11:19, Phoenix Kiula wrote:
INSERTs in the parent table don't need to check for any reference from the
child table,
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Phoenix Kiula
Sent: Tuesday, December 06, 2011 11:46 AM
To: Alban Hertroys
Cc: PG-General Mailing List
Subject: Re: [GENERAL] Foreign keys question (performance)
On Sun
On 12/06/2011 08:45 AM, Phoenix Kiula wrote:
On Sun, Dec 4, 2011 at 7:41 PM, Phoenix Kiulaphoenix.ki...@gmail.com wrote:
On Sun, Dec 4, 2011 at 7:14 PM, Alban Hertroysharam...@gmail.com wrote:
On 4 Dec 2011, at 11:19, Phoenix Kiula wrote:
I have a problem.
Here's my table designs. The
Hi.
I have a foreign key as such:
ALTER TABLE child_table
ADD CONSTRAINT fk_child
FOREIGN KEY (stringid) REFERENCES parent_table (stringid) MATCH FULL
ON DELETE CASCADE ;
Questions:
1. Is MATCH FULL adding any value here? If the foreign key is just
on an id column, what purpose does it
On 4 Dec 2011, at 11:19, Phoenix Kiula wrote:
Hi.
I have a foreign key as such:
ALTER TABLE child_table
ADD CONSTRAINT fk_child
FOREIGN KEY (stringid) REFERENCES parent_table (stringid) MATCH FULL
ON DELETE CASCADE ;
Questions:
1. Is MATCH FULL adding any value here? If the
On Sun, Dec 4, 2011 at 7:14 PM, Alban Hertroys haram...@gmail.com wrote:
On 4 Dec 2011, at 11:19, Phoenix Kiula wrote:
INSERTs in the parent table don't need to check for any reference from the
child table, since they're new; there can't be a reference. UPDATEs and
DELETEs do though,
Hi David,
On Wed, 2011-11-09 at 09:52 -0800, David Kerr wrote:
So, aside from removing the PKs do i have any other options?
Sure you have: order the inserts by primary key inside each transaction.
Then you will not get deadlocks, but inserting the same key again will
fail of course (but that's
On Thu, Nov 10, 2011 at 09:09:06AM +0100, Csaba Nagy wrote:
- Hi David,
-
- On Wed, 2011-11-09 at 09:52 -0800, David Kerr wrote:
- So, aside from removing the PKs do i have any other options?
-
- Sure you have: order the inserts by primary key inside each transaction.
- Then you will not get
Excerpts from David Kerr's message of vie nov 04 13:01:29 -0300 2011:
I did more digging and found some good discussions on the subject in general,
but
most of the examples out there contain explicit updates (which is why i was
confused)
but it looks like it's being addressed.
On Wed, Nov 09, 2011 at 11:11:23AM -0300, Alvaro Herrera wrote:
-
- Excerpts from David Kerr's message of vie nov 04 13:01:29 -0300 2011:
-
- I did more digging and found some good discussions on the subject in
general, but
- most of the examples out there contain explicit updates (which is
Excerpts from David Kerr's message of mié nov 09 14:52:01 -0300 2011:
On Wed, Nov 09, 2011 at 11:11:23AM -0300, Alvaro Herrera wrote:
- This case is not helped by the patch I'm working on. As far as I can
- see, if you got rid of the PK in table a in your example script, things
- should
Hi David,
On Thu, 2011-11-03 at 15:30 -0700, David Kerr wrote:
I suspect that it has to be a transaction, and that further up in the TX is
an update to one of
the reference tables in each TX.
This is your cause - updating the referenced table in the same
transaction. That will want an
On Thu, Nov 03, 2011 at 03:30:20PM -0700, David Kerr wrote:
- Howdy,
-
- We have a process that's deadlocking frequently. It's basically multiple
threads inserting data into a single table.
-
- That table has FK constraints to 3 other tables.
-
- I understand how an FK check will cause a
Howdy,
We have a process that's deadlocking frequently. It's basically multiple
threads inserting data into a single table.
That table has FK constraints to 3 other tables.
I understand how an FK check will cause a sharelock to be acquired on the
reference table and in some instances that
hi,
I am in some trouble with my tables defined using inheritance, This is a
semplified test case:
---
create table sub1( name1 text) inherits(father);
create table sub2( name2 text) inherits(father);
create table other (description text, id integer);
-- I know, the
On 12/08/10 18.59, Edoardo Panfili wrote:
hi,
I am in some trouble with my tables defined using inheritance, This is a
semplified test case:
---
create table sub1( name1 text) inherits(father);
create table sub2( name2 text) inherits(father);
create table other (description
Edoardo Panfili edoa...@aspix.it writes:
On 12/08/10 18.59, Edoardo Panfili wrote:
I am in some trouble with my tables defined using inheritance,
No, foreign keys do not play very nicely with inheritance. There is
some explanation in the manual, in the Caveats subsection under
Inheritance ---
On 12/08/10 20.44, Tom Lane wrote:
Edoardo Panfiliedoa...@aspix.it writes:
On 12/08/10 18.59, Edoardo Panfili wrote:
I am in some trouble with my tables defined using inheritance,
No, foreign keys do not play very nicely with inheritance. There is
some explanation in the manual, in the
On 07/08/10 01:13, Joshua Tolley wrote:
Is there some justification for this behavior that I should know already? It
seemed awfully strange when some folkds here stumbled on it:
[snip]
The key point seems to be that the owner of the referenced table has no
permissions on the table, although
On Sat, Aug 07, 2010 at 08:34:12AM +0100, Richard Huxton wrote:
On 07/08/10 01:13, Joshua Tolley wrote:
Is there some justification for this behavior that I should know already? It
seemed awfully strange when some folkds here stumbled on it:
[snip]
The key point seems to be that the owner of
Is there some justification for this behavior that I should know already? It
seemed awfully strange when some folkds here stumbled on it:
$ create user a;
$ create user b;
$ commit;
$ \c - a
$ create table foo (id integer primary key);
$ revoke all on foo from a;
$ grant all on foo to b;
$
Tom Lane wrote:
This is what I am wondering. Whether it is done this way due to
expecation/standard, or as an implementation side effect. In the
latter case it is fixable.
I don't see how this could break a standard.
Actually, I think it does, because we went to great lengths to cause
Peter Schuller wrote:
Using PostgreSQL 8.2, I have atable one of whose columns reference a
column in othertable. I see serialization failures as a result of
*inserts* to atable in the context of:
'SELECT 1 FROM ONLY othertable x WHERE otherid = $1 FOR SHARE OF
x ' in 'INSERT INTO atable
A SELECT ... FROM othertable ... FOR SHARE won't conflict with a
concurrent update on atable.
Do I guess right that there was also an UPDATE on the row in
othertable?
Yes, that was what I meant to convey. Sorry if I was not clear. The
point was that an INSERT to atable conflicted with an
Peter Schuller wrote:
[about a serialization error caused by a foreign key constraint]
Transaction 2 now issues an INSERT on atable. This requires a
RowShareLock on the index row of the index on othertable that
is referenced by the foreign key constraint. But the corresponding
index row has
Albe Laurenz [EMAIL PROTECTED] writes:
Peter Schuller wrote:
This is what I am wondering. Whether it is done this way due to
expecation/standard, or as an implementation side effect. In the
latter case it is fixable.
I don't see how this could break a standard.
Actually, I think it does,
Hello,
Using PostgreSQL 8.2, I have atable one of whose columns reference a
column in othertable. I see serialization failures as a result of
*inserts* to atable in the context of:
'SELECT 1 FROM ONLY othertable x WHERE otherid = $1 FOR SHARE OF
x ' in 'INSERT INTO atable (otherid, col2,
On 3/20/08, Erik Jones [EMAIL PROTECTED] wrote:
I think he's talking about foreign keys from a partitioned table,
i.e. a parent and all of its child tables, to another table. That
would, at first, sound simple, but scenarios like this make it tricky
as something to be handled automatically
Hello,
I was wondering, I'm reading that there is no support for foreign keys
to inherited (child) tables -- are there any plans on supporting these
in the (near) future, and/or are there any practical workarounds for
this ?
Regards,
Leon Mergen
--
Sent via pgsql-general mailing list
Leon Mergen wrote:
Hello,
I was wondering, I'm reading that there is no support for foreign keys
to inherited (child) tables -- are there any plans on supporting these
in the (near) future, and/or are there any practical workarounds for
this ?
This has worked well for me:
CREATE TABLE
On Mar 19, 2008, at 10:42 PM, brian wrote:
Leon Mergen wrote:
Hello,
I was wondering, I'm reading that there is no support for foreign
keys
to inherited (child) tables -- are there any plans on supporting
these
in the (near) future, and/or are there any practical workarounds for
this ?
I have two classes of objects, A and B, where B is just a special case
of A. (I.e., to describe a B-type object I need to specify the same
fields as for an A-type object, plus a whole bunch additional fields
specific to B alone.) Furthermore, there's a third class T that is in
a many-to-one
On Mon, 2007-11-19 at 14:36 -0500, Kynn Jones wrote:
I have two classes of objects, A and B, where B is just a special case
of A. (I.e., to describe a B-type object I need to specify the same
fields as for an A-type object, plus a whole bunch additional fields
specific to B alone.)
Kynn Jones wrote:
I have two classes of objects, A and B, where B is just a special case
of A. (I.e., to describe a B-type object I need to specify the same
fields as for an A-type object, plus a whole bunch additional fields
specific to B alone.) Furthermore, there's a third class T that is
Kynn Jones escribió:
I have two classes of objects, A and B, where B is just a special case
of A. (I.e., to describe a B-type object I need to specify the same
fields as for an A-type object, plus a whole bunch additional fields
specific to B alone.) Furthermore, there's a third class T that
On Mon, 2007-11-19 at 17:19 -0300, Alvaro Herrera wrote:
Kynn Jones escribió:
I have two classes of objects, A and B, where B is just a special case
of A. (I.e., to describe a B-type object I need to specify the same
fields as for an A-type object, plus a whole bunch additional fields
Hi all,
pg 8.2.4 on Fedora Core 6 x86-64, mostly default postgres.conf just
shared memory buffers increased to 256M. 1GB RAM.
I attempt to insert ~200k rows into table in one transaction from psql
console, calling stored function of plperlu language, which inserts row
by row via
On Tue, 2007-10-09 at 11:28 +0200, Jan Poslusny wrote:
pg 8.2.4 on Fedora Core 6 x86-64, mostly default postgres.conf just
shared memory buffers increased to 256M. 1GB RAM.
I attempt to insert ~200k rows into table in one transaction from psql
console, calling stored function of plperlu
Dear list,
This might be too basic for a question but I just couldn't find the
answer so far.
Does PostgreSQL create an implicit index also for foreign keys? or must
I create it explicitly?
Thank you,
Marc Compte
---(end of broadcast)---
2007/6/5, Marc Compte [EMAIL PROTECTED]:
Dear list,
This might be too basic for a question but I just couldn't find the
answer so far.
Does PostgreSQL create an implicit index also for foreign keys? or must
I create it explicitly?
FK is just a constraint, you wil have to create indexes
On þri, 2007-06-05 at 11:49 +0200, Marc Compte wrote:
Does PostgreSQL create an implicit index also for foreign keys?
no
or must I create it explicitly?
if you want one, yes.
not everyone wants an index on all their foreign keys,
but they can be useful in some circumstances.
gnari
On Tue, Jun 05, 2007 at 11:49:20AM +0200, Marc Compte wrote:
Does PostgreSQL create an implicit index also for foreign keys? or must
I create it explicitly?
PostgreSQL doesn't create an index on the referencing column(s) of
a foreign key constraint; if you want an index then you'll need to
Does PostgreSQL create an implicit index also for foreign keys? or must
I create it explicitly?
No, you foreign keys are not automatically indexed. They only way they would
be is if the FK is
part of a composite unique or primary key. So you will probably have to create
your one indexes
on
am Tue, dem 05.06.2007, um 11:49:20 +0200 mailte Marc Compte folgendes:
Dear list,
This might be too basic for a question but I just couldn't find the
answer so far.
Does PostgreSQL create an implicit index also for foreign keys?
No, only for primary keys to enforce the uniqueness.
Marc Compte [EMAIL PROTECTED] writes:
Does PostgreSQL create an implicit index also for foreign keys? or must I
create it explicitly?
It won't allow you to create a foreign key that points to a column without a
unique index on it.
postgres=# create table b (i integer references a(i));
ERROR:
Thanks to everyone for the prompt reply :)
Good thing about answers is when they raise up new questiosn, so you can
keep on learning all the time.
This one answer, for instance, brings me another question. Does having a
composite primary mean the system will create an individual index on
Marc Compte wrote:
Thanks to everyone for the prompt reply :)
Good thing about answers is when they raise up new questiosn, so you
can keep on learning all the time.
This one answer, for instance, brings me another question. Does having
a composite primary mean the system will create an
On Tue, 2007-06-05 at 17:07 +0200, Marc Compte wrote:
For instance, in the implementation of a N:M relationship, declaring
the
primary as (foreign1, foreign2) will create two indexes? or just one?
Just one
--
Oliver Elphick [EMAIL PROTECTED]
Isle
Here's something I've just noticed:
CREATE TABLE foo (f INTEGER PRIMARY KEY);
INSERT INTO foo VALUES (1);
CREATE TABLE bar (b INTEGER REFERENCES foo);
CREATE TABLE bar1 () INHERITS (bar);
INSERT INTO bar1 VALUES (1);
This is quite correct:
TRUNCATE foo;
ERROR: cannot truncate a table
Florian Weimer wrote:
Here's something I've just noticed:
CREATE TABLE foo (f INTEGER PRIMARY KEY);
INSERT INTO foo VALUES (1);
CREATE TABLE bar (b INTEGER REFERENCES foo);
CREATE TABLE bar1 () INHERITS (bar);
INSERT INTO bar1 VALUES (1);
This is quite correct:
No, it isn't; try
Let me start by saying I understand that postgresql does not support the
following: composite data types with individual components acting as
foreign keys, arrays of composite data types, and arrays with elements
acting as foreign keys. I will layout my example using them for clarity
even though
I read in documentation that primary key doesn't require additional indexes but I could find nothing about foreign keys.
Do I need to create additional indexes when I create foreign keys?
Example:
create table master
{
master_id INT4,
master_name VARCHAR(64),
CONSTRAINT master_pkey PRIMARY KEY
On Wed, 8 Jun 2005, Dan Black wrote:
I read in documentation that primary key doesn't require additional indexes
but I could find nothing about foreign keys.
Do I need to create additional indexes when I create foreign keys?
Example:
create table master
{
master_id INT4,
master_name
Dan Black wrote:
I read in documentation that primary key doesn't require additional indexes
but I could find nothing about foreign keys.
Do I need to create additional indexes when I create foreign keys?
Example:
create table master
create table slave
Do I need to create index
CREATE
I've observed that inserts into slave table became slower when I use foreign key than without one.
Can it be related to foreign key?
And I am interested how much performance of database with foreign
keys can be different from performance of database without foreign
keys? In other words, how much
On Wed, 2005-06-08 at 12:39, Dan Black wrote:
I've observed that inserts into slave table became slower when I use
foreign key than without one.
Can it be related to foreign key?
And I am interested how much performance of database with foreign
keys can be different from performance of
I think 21 interns will be enough :)2005/6/8, Scott Marlowe [EMAIL PROTECTED]:
On Wed, 2005-06-08 at 12:39, Dan Black wrote: I've observed that inserts into slave table became slower when I use foreign key than without one. Can it be related to foreign key? And I am interested how muchperformance
First of all, hi. I'm new to this mailing list.
I searched this on the net, but I didn't get any usable answers...
So here's my problem:
I have 2 schemas. One is called SITE, one SITE_forum.
What I wanted, is to separate the forum from the whole Site db, so I can
put them on different
On Wed, Apr 13, 2005 at 13:54:05 +0200,
Matthias Loitsch [EMAIL PROTECTED] wrote:
So I thought I could make a foreign key on a different Schema (db), and
use the same table
And well, thats where I started to search if this is possible ... and,
in fact my main question is: Is this a
Will inherits helps you ?
create table SITE_forum.t1 () inherits (SITE.t);
Oleg
On Wed, 13 Apr 2005, Matthias Loitsch wrote:
First of all, hi. I'm new to this mailing list.
I searched this on the net, but I didn't get any usable answers...
So here's my problem:
I have 2 schemas. One is called
Greetings,
I'm using pg 7.3.5 and playing with table inheritance, and I've run into the
fact that foreign keys cannot be defined on inherited attributes. (As much
is stated in the documentation, but it didn't sink in until I ran into the
fact.)
The documents say this will probably be fixed in a
Well, it's not a table! It's a view:
dbs=# \d pg_user
View pg_catalog.pg_user
Column| Type | Modifiers
-+-+---
usename | name|
usesysid| integer |
usecreatedb | boolean |
usesuper| boolean |
usecatupd | boolean |
passwd | text
On Thu, Jun 26, 2003 at 02:12:22PM +0100, Richard Huxton wrote:
snip
It looks like he has a centralised address table with customer_addresses
linking customer to address. Likewise for supplier.
His problem was he wanted to remove address details when nothing referred to
them any more.
Hello!
I have a question regarding foreign keys and general garbage collection
of data... If anyone could provide assistance, it'd be much appreciated!
Basically, we have a fairly complex database, with many tables
(customers, etc) that need to reference addresses that are contained in
a generic
On Thu, Jun 26, 2003 at 12:00:07 +0100,
Matt Browne [EMAIL PROTECTED] wrote:
Other tables also reference records in the address table, using a
similar sort of scheme.
I have foreign keys set up so that if, for example, a record in customer
is deleted, the corresponding records in the
I have foreign keys set up so that if, for example, a record
in customer
is deleted, the corresponding records in the customer_addresses table
are also removed. However, I can't find a way of ensuring
records in the
address table are deleted too, given that lots of different
tables will
Matt Browne wrote:
Hello!
I have a question regarding foreign keys and general garbage collection
of data... If anyone could provide assistance, it'd be much appreciated!
Basically, we have a fairly complex database, with many tables
(customers, etc) that need to reference addresses that are
Hello again -
This problem has now been resolved, using triggers.
A big thank you to everyone who reponded! I'd buy you all a beer if...
Er... This list was a bar.
Cheers!
--
Matt Browne [EMAIL PROTECTED]
---(end of broadcast)---
TIP 4: Don't
On Thursday 26 Jun 2003 1:40 pm, Rich Shepard wrote:
Matt Browne wrote:
Basically, we have a fairly complex database, with many tables
(customers, etc) that need to reference addresses that are contained in
a generic address table.
So:
customer_addresses [table]
If I create a columnA in a tableA that REFERENCES tableB(columnB) in
another table, where column B is not null, does that imply a NOT NULL on
my columnA? In other words, does it ensure that the value of A is in the
set of values for B, or that the value of A is in the Bs unless A is null?
On Mon, 27 Aug 2001, Neal Lindsay wrote:
If I create a columnA in a tableA that REFERENCES tableB(columnB) in
another table, where column B is not null, does that imply a NOT NULL on
my columnA? In other words, does it ensure that the value of A is in the
set of values for B, or that the
How can you get a listing of foreign keys to a table?
We haven't figure out a good way yet. The pg_depend discussion on
hackers may lead to a solution if we evern implement it.
--
Bruce Momjian| http://candle.pha.pa.us
[EMAIL PROTECTED] | (610)
It was a little bit late when I wrote that, and so I
probably should have been a little more specific. I
don't know if you would notice a performance
difference between the joined tables query and and the
non-joined version for such simple tables. I might
have to spend a bit of time today
On Thu, 21 Jun 2001 [EMAIL PROTECTED] wrote:
Is it possible to have a foreign key to a non-primary key (also
meaning non-unique and therefore non-indexed) column i a table?
Generally no. It's not allowed by the spec, so as of 7.1, we
prevent it. Admittedly, you could pull the rug out
Am Montag, 11. Juni 2001 10:25 schrieb Marc SCHAEFER:
I would remove the father and mother references, and add a
is_married
relation; as a table, with a UNIQUE(father_id), UNIQUE(mother_id)
constraint (a person can be only married once).
Is not true, at least not in some arabic
On Sun, 10 Jun 2001 [EMAIL PROTECTED] wrote:
I was just creating this little database for demonstrating the use of
foreign keys constraints.
I was about the create 3 tables, namely mother, father and child. Mother has
a foreign key pointing at father ( id ), and father has a
On Thu, 22 Mar 2001, Richard Huxton wrote:
I have to admit I've never tried referencing a view with a foreign key. I
don't know if it's possible and I have to admit the idea makes me
uncomfortable. Can't give a good reason why, but I'd apply constraints at
the table level.
if one can
On Thu, Mar 22, 2001 at 06:33:16PM -0500, Jan Wieck wrote:
Einar Karttunen wrote:
How do you put a UNIQUE constraint on the entire inheritance
hierarchie?
Easy. You make a unique index that covers an entire inheritance hierarchy.
If lots of table inherit a field "id" from a single
You can reconstruct the information out of the triggers
that are created in pg_trigger. It's not easy to
parse however.
There are three triggers created for each fk constraint,
one on the fk table, two on the pk table. You can
get the tables, columns constrained and match type from
the
I have PostgreSQL 6.5, and I can't get foreign keys to work! What seems to
be the problem?
On Thu, Feb 01, 2001 at 07:59:16PM -0500, No Name wrote:
I have PostgreSQL 6.5, and I can't get foreign keys to work! What seems to
be the problem?
Your database is too purple.
--
Adam Haberlach|A cat spends her life conflicted between a
[EMAIL PROTECTED] |deep, passionate,
Quick easy one:
Could someone please tell me the syntax for adding
a foreign key constraint to an existing row in an existing table.
Thanks.
1 - 100 of 115 matches
Mail list logo