b - c
aid <--+ bid <--+ cid
data1 +-->aid +-->bid
data2 field1 info1
date3 field2 info2
SELECT a.*,b.*,c.* from a,b,c where b.aid = a.aid and c.bid = b.bid;
So, the goal is to duplicate an object that is made up of the data stored
pdq| 789| pdq789
I'd like to get this:
oldbid | newbid
1 | 4
2 | 5
3 | 6
Any ideas? If someone has an alternate method of achieving the same result
I'd be excited to hear about it.
Matthew Nuzum | ISPs: Make $200 - $5,000 per referral by
www.followers.ne
te.
Right now, I get the job done in code, but it feels inefficient.
Matthew Nuzum | ISPs: Make $200 - $5,000 per referral by
www.followers.net | recomending Elite CMS to your customers!
[EMAIL PROTECTED] | http://www.followers.net/isp
---(
I'm not a postgres expert, and I certainly don't know the details of your
situation, but it seems to me you may want to use a rule instead of a
trigger.
Then, you can intercept the delete query and simply re-write it to be an
update query that sets your deleted flag.
--
Mat
sec
(2 rows)
BTW, this started out as a question about how to do it, but in the process
of thinking my question out, the answer came to me. ;-)
Matthew Nuzum
www.bearfruit.org
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
x27;;
on pg 7.3.2 this produces the error:
ERROR: Bad timestamp external representation '00:20'
Thanks for any help,
--
Matthew Nuzum
[EMAIL PROTECTED]
www.bearfruit.org
---(end of broadcast)---
TIP 6: Have you
edure mentioned from RI_FKey_noaction_del
to RI_FKey_cascade_del?
Do I have to do a DROP TRIGGER first?
I know I can just try it, but last time I got creative with this, it
cost me a couple hours trying to recreate things.
Matthew Nuzum
www.bearfruit.org
[EMAIL PROTECTED]
-
s book, PostgreSQL: Introduction and
Concepts, "Rules allow actions to take place when a table is accessed.
In this way, they can modify the effects of SELECT, INSERT, UPDATE, and
DELETE."
I'm sure that you can think of several acceptable solutions if you learn
to distrus
the gap left by the
deleted item. Therefore the count() of the items in the table should
also match the highest numbered item.
--
Matthew Nuzum
www.bearfruit.org
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 5: Have you checked our
Hmm... I've never used this before. I'll try it.
Thanks for your help and your quick reply!
--
Matthew Nuzum
www.bearfruit.org
[EMAIL PROTECTED]
> Fortunately we have the set functions, specifically UNION ALL in this
> case.
>
> Maybe something like (minus the numb
side note, this operation will be performed quite frequently
and should be fast.
As I think about it, it seems that the only logical way would be to do
this at the application level, not inside postgres. Please correct me
if I'm wrong.
--
Matthew Nuzum
www.bearfruit.org
[EMAIL PR
> -Original Message-
> From: Tomasz Myrta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 3:00 PM
> To: Matthew Nuzum
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] lost on self joins
> >Finaly, a table to allow a many to many join called files_fol
gsql function, however I don't know how I'd
use recursion there.
Thanks,
--
Matthew Nuzum
www.bearfruit.org
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
13 matches
Mail list logo