Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Tom Allison
I think I fixed the rest of my sql statements with the following: insert into tokens (token)select values.token from (values TOKEN_LIST_STRING ) as values(token) left outer join tokens t using (token) where t.token_idx is null insert into user_token(user_idx, token_idx)select $self->{user_idx},

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Tom Allison
Thank you very much for all your help!!! Solved this one rather nicely: my $glue = q{'),(E'}; my $string = "(E'" . join($glue, map{quotemeta } @$tokens) . "')"; my $sql =<( select token_idx from user_token where user_idx = $self-> {user_idx}) "ut" using (token_idx) SQL $sql =~ s/TOK

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Gregory Stark
"Tom Allison" <[EMAIL PROTECTED]> writes: > This is getting really ugly... > it won't finish in less than .. minutes. > > spam=> explain select u2.token_idx, t.token_idx, foo.token from > tokens t left outer join user_token u1 using (token_idx), > users u left outer join user_token u2 using (user

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Tom Allison
I agree I'm going in the wrong direction. in a Venn sort of way, what I'm trying to do is: values(...) --> left outer --> tokens --> left outer --> (user_tokens where user_tokens.user_idx = users.user_idx and users.user_idx = 4) To give me a list of all values || any matching token || any m

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Richard Broersma Jr
--- Tom Allison <[EMAIL PROTECTED]> wrote: > This is getting really ugly... > it won't finish in less than .. minutes. > > spam=> explain select u2.token_idx, t.token_idx, foo.token from > tokens t left outer join user_token u1 using (token_idx), > users u left outer join user_token u2 using (us

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Tom Allison
This is getting really ugly... it won't finish in less than .. minutes. spam=> explain select u2.token_idx, t.token_idx, foo.token from tokens t left outer join user_token u1 using (token_idx), users u left outer join user_token u2 using (user_idx), (values('one'),('want'),('examine'),('three'))

Re: [GENERAL] stuck on values in 8.2

2007-05-12 Thread Gregory Stark
"Tom Allison" <[EMAIL PROTECTED]> writes: > OK, after reviewing many emails and what I was trying to do I upgraded from > 8.2. > > Seems to work as it did in 8.1 which is a good start. > > I'm doing all of this so I can use the 'values' that was described as being > something like: > > select *

[GENERAL] stuck on values in 8.2

2007-05-12 Thread Tom Allison
OK, after reviewing many emails and what I was trying to do I upgraded from 8.2. Seems to work as it did in 8.1 which is a good start. I'm doing all of this so I can use the 'values' that was described as being something like: select * from (values ('one','two','three')) "foo"; But inste