Обсуждение: problem with nested views

Поиск
Список
Период
Сортировка

problem with nested views

От
Travis Bauer
Дата:
Can I create views based on a combination of an existing view and the
table on which it was originally based?  When I try this, I am getting no
error, but the numbers in some columns of the resulting view are not
correct.

Thanks,

----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------


Re: problem with nested views

От
Travis Bauer
Дата:
What do you mean by "properly qualifying?"  The query would look something
like this:

select keyword.token, keyword.value as kvalue, globalkw.value from
keyword, globalkw where keyword.token=globalkw.token;

A single record in globalkw should match multiple records in keyword.  The
single record in globalkw comes from an agregate function over
keyword.

The curious thing is that if I execute the command:

create table tglobalkw as select * from globalkw;

Then run the above select statement over tglobalkw instead of over
globalkw, then it works fine.

Any advice on this would help me a lot.  If this doesn't work, my Java
application has to do a lot more work.  I'm trying to pass off these
calculations to the database.

----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

On Sat, 29 Apr 2000, Anand Raman wrote:

> Hi Travis
> technically there shouldnt be any problems with such a setup.. Are u
> properly qualifying all the columns.. Just a thought
> Hope this helps
> Anand
>
> ----- Original Message -----
> From: Travis Bauer <trbauer@indiana.edu>
> To: <pgsql-general@postgresql.org>
> Sent: Friday, April 28, 2000 10:08 PM
> Subject: [GENERAL] problem with nested views
>
>
> > Can I create views based on a combination of an existing view and the
> > table on which it was originally based?  When I try this, I am getting no
> > error, but the numbers in some columns of the resulting view are not
> > correct.
> >
> > Thanks,
> >
> > ----------------------------------------------------------------
> > Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
> > ----------------------------------------------------------------
> >
>



Re: problem with nested views

От
Travis Bauer
Дата:
Thank you, I think that is what it is.  I noticed that when the view
fails, it the values that are incorrect are sums of what should appear in
multiple records.  Is there any obvious way around this problem?

Thanks,
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

On Sat, 29 Apr 2000, Stephan Szabo wrote:

>
> I believe that the problem may be that aggregates/group by in view are not
> always
> expanded correctly when they are then used in a join.
>
> >From the TODO file:
>  Views containing aggregates sometimes fail. (Jan)