[SQL] TOTALLY OFFTOPIC !!

2001-07-08 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey I'm in Pamplona !!! It's Sanfermin !! ;-))) Happy happy bye - -- Fernando Moyano Frase del día: - -- If bugs bother you then close your Windows. (*) SymeX ==> http://symex.lantik.com (*) WDBIL ==> htt

[SQL] cache lookup failed ???? What is it ???!!!

2001-06-22 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I can't execute this SQL query: DELETE FROM piezas WHERE ord_mec = '01-001' I get: ERROR: fmgr_info: function 39816: cache lookup failed Can someone help me with this error ?? ** CREATE TABLE

[SQL] corrupted tables !!!

2001-05-26 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have big problems with my postgres. There is a table that gets corrupted frecuently !!! (every week ...) I have to drop the table and create it again using the backup copy. (normally i lose some data) Can it gets corrupted bucause of bad usage of

[SQL] implied rows when a rule gets executed.

2001-05-22 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In a rule... is there some way of getting the number of rows updated by the query that activates this rule ?? Martín Marqués says: >You'll have to do more advance programing there. See if count(*) can help >you >in any way. >I see you have to up

[SQL] RULES

2001-05-22 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Well ... i'm testing carefully the two rules ==> CREATE RULE piezas_add AS ON insert TO piezas DO update materia_prima set usadas=(usadas+1) where n_material=new.n_material; CREATE RULE piezas_delete AS ON delete

[SQL] RULES

2001-05-21 Thread J.Fernando Moyano
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I need something like this . CREATE RULE piezas_add AS ON insert TO piezas DO update materia_prima set usadas=(usadas+1) where n_material=new.n_material; CREATE RULE piezas_delete AS ON delete TO piezas D

[SQL] Table corrupted and data lost (second time in one month!!)

2001-04-24 Thread J.Fernando Moyano
This is the second time in this month FATAL 1: Memory exhausted in AllocSetAlloc() pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. A table has been corrupted and i don't know why... It's

Re: [SQL] very very slow .....

2001-04-05 Thread J.Fernando Moyano
El Jueves 05 Abril 2001 04:10, escribiste: > > You would probably have better luck if you cast the date restriction > as a range, for example > > where fecha_factura >= '2001-03-01' > and fecha_factura < '2001-04-01' True It runs 10 times faster !!! You are a genius ;-)) Thanks

[SQL] very very slow .....

2001-04-02 Thread J.Fernando Moyano
I have a system called "eisenor" running in 6.5 and it runs very well. I'have installed 7.0.2 at home and i'm working with it and "eisenor". Tables are created without problems, and functions too (except some minor changes related to date/time). Very complex queries execute without error ... b

[SQL] ON DELETE rule

2001-04-01 Thread J.Fernando Moyano
I'm trying to do something like this: CREATE RULE piezas_delete AS ON delete TO piezas DO update materia_prima set usadas=(usadas-1) where n_material=old.n_material; The rule is created. OK but the action doesn't run like it's supossed. ¿What is wrong? Is "old" usa

Fwd: Re: [SQL] sum(bool)?

2001-02-25 Thread J.Fernando Moyano
El Viernes 23 Febrero 2001 16:22, escribiste: > hi there, > > i want to add up the "true" values of a comparison like > > sum(a>b) > > it just doesn't work like this > > any workaround? > > it is postgresql 7.0 under linux > > thanks > > olaf I did exactly the same thing two months ago I c

[SQL] type casting: varchar to date

2001-02-06 Thread J.Fernando Moyano
Is there some way to do something like this ?? : crate table t ( a varchar(12), b date ); select (a::date-b) from t; ERROR: cannot cast type 'varchar' to 'date'. Thanks -- Fer