Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1CG1nx21485 for ; Mon, 12 Feb 2001 11:01:49 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f1CG1f918643; Mon, 12 Feb 2001 11:01:41 -0500 (EST) To: Giovanni Biscuolo cc: pgsql-sql@postgresql.org Subject: Re: view does not show all records it should In-reply-to: <3A87F92F.49345962@libero.it> References: <3A87F92F.49345962@libero.it> Comments: In-reply-to Giovanni Biscuolo message dated "Mon, 12 Feb 2001 15:54:39 +0100" Date: Mon, 12 Feb 2001 11:01:41 -0500 Message-ID: <18640.981993701@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200102/211 X-Sequence-Number: 1401 Giovanni Biscuolo 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