Re: [SQL] indexing

2003-02-24 Thread Josh Berkus
James, > if I had three tables for a many to many relationship say A, B, AND C > B being the lookup. B being a huge 50k rows plus column and made just two forigen keys(b.a_id,b.c_id). > is it best to create two non-unique indexes or one unique index on both fields? That depends on whether all t

[SQL] indexing

2003-02-24 Thread James Cooper
Hi all,   I've been doing a little reading on indexing in prelude to indexing my db. I have the following to ask:   if I had three tables for a many to many relationship say A, B, AND C B being the lookup. B being a huge 50k rows plus column and made just two forigen keys(b.a_id,b.c_id). is i

Re: [SQL] syntax question

2003-02-24 Thread Josh Berkus
Jeff, > I think Josh meant to say you can't select the results of a *dynamically > constructed* query without a loop --- that is, you need FOR ... EXECUTE. > A plain EXECUTE doesn't support plpgsql's notion of SELECT INTO. That's correct. See the rest of the thread. -- Josh Berkus Aglio Databa

Re: [SQL] Help with query involving aggregation and joining.

2003-02-24 Thread Christoph Haller
> > ERROR: > SELECT DISTINCT ON expressions must match > initial ORDER BY expressions may be gotten over by > wrapping the first query result in a subselect. > > not sure though if its proper. > regds > mallah. > > test=# SELECT * from ( SELECT distinct on (a.id) b.id > ,courseid,name,submission

Re: [SQL] Help with query involving aggregation and joining.

2003-02-24 Thread Rajesh Kumar Mallah
ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions may be gotten over by wrapping the first query result in a subselect. not sure though if its proper. regds mallah. test=# SELECT * from ( SELECT distinct on (a.id) b.id ,courseid,name,submission from course a joi

Re: [SQL] Porting from db2 problem

2003-02-24 Thread Christoph Haller
> > I am trying to port an app that currently runs over db2 and oracle (on windows > os/2 linux hpux aix etc) to also run over postgres. > I am currently porting the windows client (using odbc). > I am having major problems because of the lack of with hold cursors (cursors > that remain open ove