Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bs5pU-0003uK-MX for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Oct 2016 10:23:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bs5pT-0008Nw-V7 for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Oct 2016 10:23:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bs5op-0006vi-2s; Thu, 06 Oct 2016 10:22:27 +0000 Received: from mail.heales.com ([109.235.147.222] helo=hmmailserver2.com) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bs5on-0003AE-1z; Thu, 06 Oct 2016 10:22:26 +0000 X-Virus-Scanned: amavisd-new at hmmailserver2.com Date: Thu, 6 Oct 2016 11:22:23 +0100 (BST) From: Bujji Babu To: pgsql-bugs@postgresql.org, pgsql-sql@postgresql.org Message-ID: <535504359.1542314.1475749343449.JavaMail.zimbra@heales.com> In-Reply-To: <1946969724.1542248.1475749293586.JavaMail.zimbra@heales.com> Subject: SQL Bug MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1542313_1583396969.1475749343448" X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF49 (Win)/8.0.9_GA_6191) Thread-Topic: SQL Bug Thread-Index: K+b84u2OLLvV0mVIxB5u1vgRE17d9Q== X-Pg-Spam-Score: -4.5 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ------=_Part_1542313_1583396969.1475749343448 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Version string: PostgreSQL 9.5.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit Please let me know if anyone knows how to fix this. below query works fine in version 9.4. select * from connectby('emp','empid','mgrid','1',0) AS t(keyid text, parent_keyid text, level int); ERROR: invalid return type DETAIL: SQL key field type text does not match return key field type integer. ********** Error ********** ERROR: invalid return type SQL state: 42804 Detail: SQL key field type text does not match return key field type integer. CREATE TABLE public.emp ( empid integer NOT NULL, name text, mgrid integer, CONSTRAINT emp_pkey PRIMARY KEY (empid) ) insert into emp(empid,mgrid,name) values(1,0,'emp1'); insert into emp(empid,mgrid,name) values(2,1,'emp1'); insert into emp(empid,mgrid,name) values(3,1,'emp1'); insert into emp(empid,mgrid,name) values(4,2,'emp1'); insert into emp(empid,mgrid,name) values(5,2,'emp1'); Thanks, M.Bujji Babu Thanks&Regards, M.Bujji Babu. ------=_Part_1542313_1583396969.1475749343448 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Version string:   PostgreSQL 9.5.4 on = x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)= , 64-bit
 
Please let me know if anyone knows how to fix this. b= elow query works fine in version 9.4.
 
 
select * from conne= ctby('emp','empid','mgrid','1',0)
AS t(keyid text, parent_keyid text, level int);
<= /div>
 =
 

ERROR: invalid return type D= ETAIL: SQL key field type text does not match return key field type integer= . ********** Error ********** ERROR: invalid return type SQL state: 42804 D= etail: SQL key field type text does not match return key field type integer= .
 
CREATE TABLE public.emp
(
empid integer NOT NULL,
name text,
mgrid integer,
CONSTRAINT emp_pkey PRIMARY KEY (empid)
)
values(1,0,'emp1');
insert into emp(empid,mgrid,name)
values(2,1,'emp1');
insert into emp(emp= id,mgrid,name)
values(3,1,'emp1');
insert into emp(empid,mgrid,name)
values(4,2,'emp1');
insert into emp(empid,mgrid,name)
values(5,2,'emp1');
 

Thanks,
M.Bujji Babu

Thanks&= Regards,
M.Bujji Babu.

<= /div> ------=_Part_1542313_1583396969.1475749343448--