On Wed, 18 May 2011 20:10:19 +0100, Gary Stainburn wrote about [SQL]
foreign keys and lots of tables:
>I have the following tables (individual seat allocation removed to
>make it simpler)
Omitting details makes the problem more difficult to comprehend.
[snip]
>create table booking_seats (
> b_i
Hi-
On Jul 29, 2009, at 4:16 PM, Kjell Rune Skaaraas wrote:
Hello,
I'm having a problem using foreign keys, or at least in a way i find
good. Basicly I have a table I wish to use as a foreign key with
lookup "id" and "code", like:
1,a
1,b
1,c
2,a
2,d
I have of course an UNIQUE on (id,c
Dirk Jagdmann <[EMAIL PROTECTED]> writes:
> Now I'd like to know if the current order of deletions in PostgreSQL
> is intended in the top-down way or if that could be changed?
Sorry, I don't see much chance of changing it.
regards, tom lane
---(end
Hello Tom,
> If you want the whole transaction rolled back, raise an error instead
> of returning NULL.
You're right, that's working. But now I have a slightly different problem.
I assume that the trigger which watches the cascaded deletions first
deletes the row in the monitored table and then
Dirk Jagdmann <[EMAIL PROTECTED]> writes:
> The idea behind the sample commands below is, that the whole deletion
> should be denied, because a trigger in a cascaded table blocked the
> deletion. The trigger works as expected and prevents rows with a value
> of "5" being deleted from table "b". How
Thanks to everyone for the responses ... ended up doing a trigger on the
comments table that updates another table to maintain a "pointer" to the
active record ... sped up the query that was hampering us from ~26 000ms
to 47ms ... the killer part of the query was that each time it was havin
g
On Thursday 05 January 2006 04:58, [EMAIL PROTECTED] wrote:
>That's not what foreign keys do. The only thing a foreign key
> provides is a guarantee that if any records in B (the referencing
> table) still reference a record in table A (the referenced table)
> then you cannot delete that reference
> Now, what I want to do is add a FOREIGN KEY (again, I think) that when
> incident_summary.status is changed (either closed, or reopened), the
> associated records in incident_comments are changed to the same state ...
As the other responders mentioned, from the schema you described, it
doesn't l
Marc
Is the "assumption" that anytime there are comments the status
changes?
If I'm reading between the lines correctly, there could be a large
number of comments before the status changes. So no need to change
status until explicitly needed.
If there is a specific "comment" th
On Wed, 4 Jan 2006, Tom Lane wrote:
"Marc G. Fournier" <[EMAIL PROTECTED]> writes:
Now, what I want to do is add a FOREIGN KEY (again, I think) that when
incident_summary.status is changed (either closed, or reopened), the
associated records in incident_comments are changed to the same state ..
"Marc G. Fournier" <[EMAIL PROTECTED]> writes:
> Now, what I want to do is add a FOREIGN KEY (again, I think) that when
> incident_summary.status is changed (either closed, or reopened), the
> associated records in incident_comments are changed to the same state ...
Why not just get rid of the s
hi folks,
For a certain table A, I need to find out the names of the columns who have
a foreign key to a specific table B using the catalog.Has anyone done this
before entirely using pgsql.I have been through the archieves and have not
been able to find the required information.
thanks
kprasad
Foreign keys are not supported in that version :p see:
http://www.postgresql.org/devel-corner/docs/
"" wrote:
> I have PostgreSQL 6.5, and I can't get foreign keys to work! What seems to
> be the problem?
13 matches
Mail list logo