Re: [SQL] matching rows differing only by fkey,pkey

2004-06-22 Thread Matthew Nuzum
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

[SQL] matching rows differing only by fkey,pkey

2004-06-22 Thread Matthew Nuzum
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

[SQL] most efficient way to manage ordering

2004-06-01 Thread Matthew Nuzum
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 ---(

Re: [SQL] trigger : emulate "instead of" with before ?

2003-06-13 Thread Matthew Nuzum
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

[SQL] recursive srf

2003-05-29 Thread Matthew Nuzum
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

[SQL] showing records from the last 20 min

2003-03-18 Thread Matthew Nuzum
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

[SQL] changing referential integrety action on existing table

2003-02-06 Thread Matthew Nuzum
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] -

Re: [SQL] Scheduling Events?

2003-01-26 Thread Matthew Nuzum
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

[SQL] cannot create function that uses variable table name

2003-01-16 Thread Matthew Nuzum
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

Re: [SQL] show data from two tables together

2003-01-15 Thread Matthew Nuzum
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

[SQL] show data from two tables together

2003-01-15 Thread Matthew Nuzum
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

Re: [SQL] lost on self joins

2003-01-15 Thread Matthew Nuzum
> -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

[SQL] lost on self joins

2003-01-15 Thread Matthew Nuzum
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]