Re: [SQL] Preventing Deletions with triggers

2004-05-21 Thread Tom Lane
Jeff Post <[EMAIL PROTECTED]> writes: > CREATE or replace FUNCTION person_fake_delete() RETURNS TRIGGER AS ' > BEGIN > OLD.status := 1; -- This does the fake deletion > RETURN NULL; -- I thought this would prevent the delete from > actually happening. > END; > ' LANGUA

Re: [SQL] Preventing Deletions with triggers

2004-05-21 Thread Manuel Sugawara
Jeff Post <[EMAIL PROTECTED]> writes: > Here is what I got: > > CREATE or replace FUNCTION person_fake_delete() RETURNS TRIGGER AS ' > BEGIN > OLD.status := 1; -- This does the fake deletion > RETURN NULL; -- I thought this would prevent the delete from > actually happenin

Re: [SQL] Problem with JOINS

2004-05-21 Thread Tom Lane
Charlie Clark <[EMAIL PROTECTED]> writes: > WHERE true > AND > person.id_status = 2 > AND > person.id_authorise = 2 > AND > ltrim(lower(address.ort)) like lower('Neuss%') > AND > bs.value = 'bezahlt' OR bs.value = 'erlassen' > AND > users.roles like '%Premium' AND binds more tightly than OR --- I

Re: [SQL] Problem with JOINS

2004-05-21 Thread Stephan Szabo
On Fri, 21 May 2004, Charlie Clark wrote: > SELECT > gender.value as anrede_value, > person.name as person_name, > person.vorname as person_vorname, > person.zusatz as person_zusatz, > person.birthdate as person_birthdate, > address.strasse as address_strasse, > address.hausnummer as address_hau

Re: [SQL] XML data field

2004-05-21 Thread Richard Huxton
[EMAIL PROTECTED] wrote: Does anyone have any experience in retrieving and formatting an XML data from a field using pgSQL? Are there any system stored procs that could reformat the XML elements or just retrieve the elements needed? There are some xml-related functions in the contrib/ directory of

Re: [SQL] Preventing Deletions with triggers

2004-05-21 Thread Achilleus Mantzios
O kyrios Jeff Post egrapse stis May 19, 2004 : > I would like to have a trigger that fires whenever a delete is attempted. > The trigger should update the status field of the tupple (to remove the > tupple form the active set of tupples). > A rule would be more appropriate for this task. > >

Re: [SQL] Replace function ...

2004-05-21 Thread Kornelije Rabuzin
thanks If I don't find some other solution, I'll do it . so, thanks ... best regards Kornelije On Wed, 19 May 2004, BenLaKnet wrote: > I try to reencode postgresql db ... all is running ... in your shell : > > - pg_dump db -f fileout > > - iconv fileout i do not remember paramete

Re: [SQL] Replace function ...

2004-05-21 Thread Kornelije Rabuzin
Thank you very much, but the database I'm using is not mine that's why I cannot change anything If I wont manage to write this replace function, I'll probably use this solution ... so thank you best regards R. K. On Wed, 19 May 2004, [ISO-8859-1] Benoît BOURNON wrote: > I try to r

[SQL] Problem with JOINS

2004-05-21 Thread Charlie Clark
Dear list, I've recently noticed that I've got a problem with query. It seems that due to some of the conditions I'm setting an implicit OUTER JOIN is occuring which is overriding another condition. I'm enclosing two queries. The first returns a list of people in a particular cities, the secon

[SQL] Preventing Deletions with triggers

2004-05-21 Thread Jeff Post
I would like to have a trigger that fires whenever a delete is attempted. The trigger should update the status field of the tupple (to remove the tupple form the active set of tupples). Here is what I got: CREATE or replace FUNCTION person_fake_delete() RETURNS TRIGGER AS ' BEGIN OLD

[SQL] XML data field

2004-05-21 Thread LSanchez
Does anyone have any experience in retrieving and formatting an XML data from a field using pgSQL? Are there any system stored procs that could reformat the XML elements or just retrieve the elements needed?   Thanks! - Lily Anne

Re: [SQL] How to speed up a time dimension query

2004-05-21 Thread Hans de Bruin
Gaetano Mendola wrote: Hans de Bruin wrote: ... This is not what I get with a table similiars to your: test=# select count(*) from user_logs; count - 3025880 (1 row) empdb=# explain analyze empdb-# select * empdb-# from user_logs empdb-# where login_time between (now()-interval '25 hour

[SQL] Any sql repository

2004-05-21 Thread T Ullas
Hi I would like to know whether there are any websites which has general sql repositories like for eg countries with their currency, ISO Name etc. Also if there are any schema standards in accounting packages for medium size companies. I am not sure if this is what XML DTD is all about. Thankin

Re: [SQL] v7.2 triggers and foreign keys

2004-05-21 Thread Richard Huxton
Paul Gimpelj wrote: Hi, I have two tables a and b.; b references a. I used pgaccess to create tables. and psql to create the triggers and foreign keys. a has sequential id, and primary key same column. As constraints they were implicit, and cascade was off. On delete of the of a b row, postgres al