Re: [SQL] How do FKs work?

2004-10-09 Thread Marc G. Fournier
On thing I failed to note here, that is probably critical ... its a 7.3 database ... On Sat, 9 Oct 2004, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: Have a table with two FKs on it ... 2 different fields in the table point to the same field in another table ... When I do an 'E

Re: [SQL] How do FKs work?

2004-10-09 Thread Marc G. Fournier
On Sat, 9 Oct 2004, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: Have a table with two FKs on it ... 2 different fields in the table point to the same field in another table ... When I do an 'EXPLAIN ANALYZE DELETE FROM table WHERE field = #;', it never comes back ... or, at lesa

Re: [SQL] How do FKs work?

2004-10-09 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > Have a table with two FKs on it ... 2 different fields in the table point > to the same field in another table ... > When I do an 'EXPLAIN ANALYZE DELETE FROM table WHERE field = #;', it > never comes back ... or, at lesat, takes a *very* long tim

[SQL] How do FKs work?

2004-10-09 Thread Marc G. Fournier
Got a problem here, and this is a new area for me ... analyzing FKs and improving their performance :) Have a table with two FKs on it ... 2 different fields in the table point to the same field in another table ... When I do an 'EXPLAIN ANALYZE DELETE FROM table WHERE field = #;', it never co

Re: [SQL] SQL confusion

2004-10-09 Thread Michael Fuhr
On Sat, Oct 09, 2004 at 01:39:45PM -0700, Andrew Ward wrote: > > CREATE TABLE name ( > namecounter integer NOT NULL, > firstmiddle character varying(64) NOT NULL, > lastname character varying(64) NOT NULL, > birthdate date, > hh smallint, > famnu integer, > ); > > Each row

Re: [SQL] SQL confusion

2004-10-09 Thread Richard Poole
On Sat, Oct 09, 2004 at 01:39:45PM -0700, Andrew Ward wrote: > > I'm running postgres 7.3.2 on linux, and making my > requests from Perl scripts using DBD::Pg. My table > structure is as follows (irrelevant cols removed) > > CREATE TABLE name ( > namecounter integer NOT NULL, > firstmidd

[SQL] SQL confusion

2004-10-09 Thread Andrew Ward
I'm trying to figure out how to do a particular query, and I'm beating my head against a wall. Here's my situation: I'm running postgres 7.3.2 on linux, and making my requests from Perl scripts using DBD::Pg. My table structure is as follows (irrelevant cols removed) CREATE TABLE name ( nam

Re: [SQL] SELECT with Function

2004-10-09 Thread Paulo Nievierowski
Dear Marcin Thanks for your reply. My created function running well as exposed by you in ttt() function and this is no problem. I need extend this query. See: TableA prod_idnumeric(10) prod_name varchar(40) ... My function, as your ttt(), return 3 values and value prod_id from TableA m