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

2003-08-25 Thread Tomasz Myrta
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.
What about this?
delete from eyp_listing where exists (select * from
  eyp_listing el
  left join company_export ce using (userid,category_id)
 where el.userid=21742 and size ilike '%WEBFL%' and ce.userid is null
  and el.userid=eyp_listing.userid
  and el.category_id=eyp_listing.category_id);
It should be solution, but not the answer for your question...
How did you use that sub-select, so it didn't work?
Regards,
Tomasz Myrta
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [SQL] [ZODB-Dev] What are the ZopeDB limit?

2003-08-25 Thread Michele Bendazzoli
On Sat, 2003-08-23 at 23:01, Dieter Maurer wrote:
cut
>  > What do you think of?
> 
> When your data fits well in a relational database
> (a huge number of highly structured records, no full text indexes),
> put it in Postgres. Otherwise, try the ZODB.
> Make some preliminary mass tests before your invest a lot in one
> approach.

Thank you very much for your in dept advices.

I think i will go for a mixed approach: I'll put the raw data in a db
managed by postgresql and documents that reassumes them in the zopedb.
This approach let me combining the advantages of both zopedb and
postgresql and should prevent future troubles.

ciao, Michele

p.s. Is there any future planning of integrating the power of postgresql
directly in the zopedb? Now that postgresql seems to become a very
independent platform database (with a native windows port) maybe can be
considered by the zopedb developers as solid ground to store the objects
managed by zope.


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [SQL] [ZODB-Dev] What are the ZopeDB limit?

2003-08-25 Thread Michele Bendazzoli
On Mon, 2003-08-25 at 09:12, Michele Bendazzoli wrote:

ops ...

apologies for the message.

Michele


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[SQL] Strange behavior with timestamptz

2003-08-25 Thread George Weaver



Hi Everyone,
 
I have a situation where two tables have a 
"Created" field defined as follows:
 
table 
seedlot "created  timestamptz  DEFAULT 
now(), "
 
table transaction"created  
timestamptz  NOT NULL  DEFAULT now(),"
 
The transaction table records when a seedlot record 
is created, with both events happening in the same plpgsql 
function.  The seedlot record is created first, with the transaction table 
being updated later in the procedure.
 
Seedlot 153 was received on August 11 with the 
following result:
 

base=# select created from seedlot where 
syslotid=153;    
created 2003-11-08 12:13:39-06(1 
row)
 
base=# select created from transaction where 
syslotid=153 and 
transactiontypeid=22;    
created 2003-08-11 12:13:39-05(1 
row)
 
Does anyone have any idea why the default for 
seedlot recorded the time with the day and month switched, resulting in the 
seedlot record being stamped Nov 8, 2003 while the transaction was 
stamped correctly as Aug 11, 2003?
 
In the same function a number of other records are 
created and timestamped.  In all cases where the table definition 
statement does not include NOT NULL, the time was stamped with the day and month 
reversed.
 
However! Two of the tables define created 
thus:
 
  "created  timestamptz   
DEFAULT now() NOT NULL,"
 
but still ended up with the day and month being 
switched.
 
The transaction record is the last one in the 
procedure to be created.
 
I am using version 7.3.2.
 
I hope I'm not missing something 
obvious...
 
Thanks for your help,
George