From: Tom Lane <tgl@sss.pgh.pa.us>
To: Giovanni Biscuolo <giovanni.biscuolo@libero.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: view does not show all records it should
Date: Mon, 12 Feb 2001 11:01:41 -0500
Message-ID: <18640.981993701@sss.pgh.pa.us> (raw)
In-Reply-To: <3A87F92F.49345962@libero.it>
References: <3A87F92F.49345962@libero.it>
Giovanni Biscuolo <giovanni.biscuolo@libero.it> writes:
> CREATE VIEW mag_scaricati_view AS
> SELECT s.id_carico, SUM(s.qta_scaricata) AS Scaricati
> FROM mag_scarico_tbl s
> GROUP BY s.id_carico;
Grouped views don't work very well in versions before 7.1, though I'm
not sure if that is the issue here or not. (What PG version are you
using, anyway?)
> Now, when I issue the following command:
> SELECT * FROM mag_giacenza1_view
> it shows me the records that was in the database the day
> I created the view, _not all the records in the database_.
> If I select "by hand" with the following statament (please
> note it is the very same with which I created the view):
> it shows me all the records.
That's fairly hard to believe, unless you ran the query using the view
inside a transaction that had been open the whole time. I suspect that
you have misinterpreted the behavior, and that the real problem is not
related to when the records were inserted. Can you show us exactly what
you're getting from each query?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, giovanni.biscuolo@libero.it
Subject: Re: view does not show all records it should
In-Reply-To: <18640.981993701@sss.pgh.pa.us>
References: <3A87F92F.49345962@libero.it> <18640.981993701@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox