Re: [SQL] update with join

2008-04-03 Thread Ivan Sergio Borgonovo
On Wed, 2 Apr 2008 23:54:18 -0300 Osvaldo Kussama [EMAIL PROTECTED] wrote: 2008/4/2, Ivan Sergio Borgonovo [EMAIL PROTECTED]: I've create table types( typeid int, special boolean not null ); create table methods( methodid int, typeid references types(typeid), );

[SQL] BROBLEM IN BETWEEN QUERY (plpgsql)

2008-04-03 Thread Anoop G
hai all, I have a plpgsql function and I am using postgresl 8.1.9 CREATE OR REPLACE FUNCTION get_vehicle_id(INT) RETURNS SETOF RECORD AS $BODY$ DECLARE r RECORD; int_day ALIAS FOR $1; BEGIN FOR r in SELECT fk_bint_old_vehicle_number AS vehicle_id FROM

Re: [SQL] BROBLEM IN BETWEEN QUERY (plpgsql)

2008-04-03 Thread A. Kretschmer
am Thu, dem 03.04.2008, um 15:54:56 +0530 mailte Anoop G folgendes: hai all, I want to select dat_replacement between now () and now - 5 dyas or now -7 days like that i want to pass the integer value as argument to the function. I show you a similar solution: test=*# select * from foo;

[SQL] GiST/GIN index for field of type VARCHAR[]

2008-04-03 Thread Yura Gal
I have following table: CREATE TABLE t1 ( name VARCHAR(500) NOT NULL, lid INTEGER NOT NULL, accs VARCHAR(20)[] NOT NULL CONSTRAINT t1_lid_key UNIQUE(lid) ); I interested in the possibility to speed-up search for rows like this: SELECT lid FROM t1 WHERE accs

[SQL] connections between servers

2008-04-03 Thread Marcin Krawczyk
Hi all. I was wondering if it's possible for a trigger to perform operations on a database on different server? I saw somewhere that there's a piece of software that allows conneciotns between different databases, but what about different servers? I also thought about using perl, would it be

Re: [SQL] apparent RI bug

2008-04-03 Thread Stephan Szabo
On Wed, 2 Apr 2008, chester c young wrote: it appears I have a broken RI in my db. call_individual.clh_id references call_household.clh_id \d call_individual ... Foreign-key constraints: call_individual_clh_id_fkey FOREIGN KEY (clh_id) REFERENCES call_household(clh_id) ON DELETE

Re: [SQL] connections between servers

2008-04-03 Thread Shane Ambler
Marcin Krawczyk wrote: Hi all. I was wondering if it's possible for a trigger to perform operations on a database on different server? I saw somewhere that there's a piece of software that allows conneciotns between different databases, but what about different servers? I also thought about

Re: [SQL] apparent RI bug

2008-04-03 Thread chester c young
Stephan Szabo [EMAIL PROTECTED] wrote: On Wed, 2 Apr 2008, chester c young wrote: it appears I have a broken RI in my db. Yeah, that looks pretty broken. Can you reproduce this from a clean start repeatedly or is this a one off? Do you ever turn off triggers, perhaps by modifying the

Re: [SQL] apparent RI bug

2008-04-03 Thread Stephan Szabo
On Thu, 3 Apr 2008, chester c young wrote: Stephan Szabo [EMAIL PROTECTED] wrote: On Wed, 2 Apr 2008, chester c young wrote: it appears I have a broken RI in my db. Yeah, that looks pretty broken. Can you reproduce this from a clean start repeatedly or is this a one off? Do you

Re: [SQL] connections between servers

2008-04-03 Thread Marcin Krawczyk
Thanks a lot, I'll give it a try. regards mk 2008/4/3, Shane Ambler [EMAIL PROTECTED]: Marcin Krawczyk wrote: Hi all. I was wondering if it's possible for a trigger to perform operations on a database on different server? I saw somewhere that there's a piece of software that allows

Re: [SQL] apparent RI bug

2008-04-03 Thread chester c young
--- Stephan Szabo [EMAIL PROTECTED] wrote: Is it possible you ever had a before delete trigger that just did a return NULL rather than raising an exception? IIRC, explicitly telling the system to ignore the delete will work on the referential actions. yes, it is possible, for example, a

Re: [SQL] apparent RI bug

2008-04-03 Thread Stephan Szabo
On Thu, 3 Apr 2008, chester c young wrote: --- Stephan Szabo [EMAIL PROTECTED] wrote: Is it possible you ever had a before delete trigger that just did a return NULL rather than raising an exception? IIRC, explicitly telling the system to ignore the delete will work on the referential

Re: [SQL] apparent RI bug

2008-04-03 Thread chester c young
--- Stephan Szabo [EMAIL PROTECTED] wrote: is it is possible, for example, a function without a body or without a return old. are you saying this would override the RI constraint? If it returned something that would have prevented the delete without an error, yes. this is very good