Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E0B931337BCF for ; Fri, 11 Mar 2011 04:28:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 66927-10 for ; Fri, 11 Mar 2011 08:28:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 0D9951337990 for ; Fri, 11 Mar 2011 04:28:18 -0400 (AST) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id p2B8SC816639 for ; Fri, 11 Mar 2011 00:28:12 -0800 Message-ID: <4D79DD17.6020900@hogranch.com> Date: Fri, 11 Mar 2011 00:28:07 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #5924: bug or feature? References: <201103110818.p2B8I9xQ070419@wwwmaster.postgresql.org> In-Reply-To: <201103110818.p2B8I9xQ070419@wwwmaster.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/185 X-Sequence-Number: 29695 On 03/11/11 12:18 AM, Ferenc Lutischan wrote: > The following bug has been logged online: > > Bug reference: 5924 > Logged by: Ferenc Lutischan > Email address: yoursoft@freemail.hu > PostgreSQL version: 8.3.14 - 9.0.3 > Operating system: Linux > Description: bug or feature? > Details: > > Dear Developers, > > Inconsecutive view handling?: > Its totally unclear to me what you're showing with the follwing sequence of operations. could you explain it perhaps ? > CREATE TABLE ifck.test_tipus > ( > tipus character varying(2) NOT NULL, > tipus_kod character varying(2) NOT NULL, > CONSTRAINT pk_test_kod PRIMARY KEY (tipus) > ) > WITH ( > OIDS=TRUE > ); > > insert into ifck.test_tipus values ('GX', 'GG'); > insert into ifck.test_tipus values ('GY', 'GG'); > insert into ifck.test_tipus values ('EX', 'EE'); > > CREATE TABLE ifck.test > ( > tipus character varying(2) NOT NULL, > status boolean NOT NULL, > id character varying(20) NOT NULL, > datum character varying(8) NOT NULL, > CONSTRAINT fk_test_tipus FOREIGN KEY (tipus) > REFERENCES ifck.test_tipus (tipus) MATCH SIMPLE > ON UPDATE NO ACTION ON DELETE NO ACTION > ) > WITH ( > OIDS=TRUE > ); > > insert into ifck.test values ('EX', true, '123456', ''); > > insert into ifck.test values ('GX', true, '123456', '20000101'); > > insert into ifck.test values ('GY', true, '123456', '20000101'); > > insert into ifck.test values ('GX', true, '123454', '19991231'); > > insert into ifck.test values ('GY', false, '123454', ''); > > insert into ifck.test values ('GY', true, '123454', '19991231'); > > CREATE OR REPLACE VIEW ifck.v_test AS > SELECT t.*, tt.tipus_kod from ifck.test t > JOIN ifck.test_tipus tt ON t.tipus::text = tt.tipus::text and status; > > CREATE OR REPLACE VIEW ifck.v_testom ifck.v_test > where tipus_kod='GG' ; > > CREATE OR REPLACE VIEW ifck.v_test3 AS > SELECT * from ifck.v_test > where tipus like 'G%' and status; > > /* > select * from ifck.v_test2 where id='123456'; > > result: > "GX";t;"123456";"20000101";"GG" > "GY";t;"123456";"20000101";"GG" > */ > > /* > select * from ifck.v_test3 where id='123456'; > > result: > "GX";t;"123456";"20000101";"GG" > "GY";t;"123456";"20000101";"GG" > */ > > /* > select * from ifck.v_test2 where id='123454'; > result: > "GX";t;"123454";"19991231";"GG" > "GY";t;"123454";"19991231";"GG" > */ > > /* > select * from ifck.v_test3 where id='123454'; > > result: > "GX";t;"123454";"19991231";"GG" > "GY";t;"123454";"19991231";"GG" > */ > > /* > select * from ifck.v_test2 where datum::date=datum::date and id='123456'; > > result: > ERROR: invalid input syntax for type date: "" > ********** Error ********** > ERROR: invalid input syntax for type date: "" > SQL state: 22007 > */ > > /* > select * from ifck.v_test2 where datum::date=datum::date and id='123454'; > > result: > "GX";t;"123454";"19991231";"GG" > "GY";t;"123454";"19991231";"GG" > */ > > /* > select * from ifck.v_test3 where datum::date=datum::date and id='123454'; > > result: > "GX";t;"123454";"19991231";"GG" > "GY";t;"123454";"19991231";"GG" > */ > > Regards, > Ferenc Lutischan >