Re: [SQL] Joined deletes but one table being a subquery.

2003-08-23 Thread Rajesh Kumar Mallah


I apologize for the silence.

t_a as been created as 

CREATE TABLE t_a as  SELECT userid,category_id from eyp_listing where userid=21742 and 
size ilike '%WEBFL%'
EXCEPT SELECT userid,category_id from company_export_profile where userid=21742 ;

so the subquery is basically 

( SELECT userid,category_id from eyp_listing where userid=21742 and 
 size ilike '%WEBFL%' EXCEPT SELECT userid,category_id from company_export_profile
 where userid=21742 )


regds
mallah.

On Friday 22 Aug 2003 3:53 pm, Tomasz Myrta wrote:
> > Hi Folks,
> >
> > DELETE  from eyp_listing where userid=t_a.userid and
> > category_id=t_a.category_id; such queries work perfectly.
> >
> > but if t_a is a subquery how to accomplish the delete.
>
> What kind of subquery it is? Exist/Not exist doesn't work?
>
> Regards,
> Tomasz Myrta
>
>
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [SQL] Delete denied?

2003-08-23 Thread Jeff Eckermann
--- Josh Berkus <[EMAIL PROTECTED]> wrote:
> Stephan, Tom:
> 
> Hey, I have a function which can involve some
> records being deleted at the 
> end.   The user calling the function has permission
> to delete records (and 
> I've tested this), but when I run the function I get
> "permission denied".
> 

I had a similar weird problem recently, also with
7.2.4.  Whether the two problems are related I can't
tell, but...

Situation: user a updates table1 (owned by a), kicks
off a trigger which updates table2 (owned by user b). 
Wouldn't work.  I tried every ownership and permission
combination that I could think of without success,
before succeeding by doing a "grant all on table2 to
a".

Since the table access is all mediated through the
application I was not worried about the "all", but the
question remains: why would "grant all" permit
updates, when "grant update" would not?

> Any clue?  I remember in 7.1.x that you couldn't
> delete records in a function, 
> but this is on 7.2.4.   
> 
> Contributing could be that the table holding the
> deleted records is a child 
> table with an "ON CASCADE DELETE" of one of the
> tables being updated 
> elsewhere in the function.  And the function works
> if called by the owner of 
> the table (and the function).
> 
> -- 
> -Josh Berkus
>  Aglio Database Solutions
>  San Francisco
> 
> 
> ---(end of
> broadcast)---
> TIP 6: Have you searched our list archives?
> 
>http://archives.postgresql.org


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---(end of broadcast)---
TIP 8: explain analyze is your friend