SQL Bug

From: Bujji Babu <bujji(dot)babu(at)heales(dot)com>
To: pgsql-bugs(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: SQL Bug
Date: 2016-10-06 10:22:23
Message-ID: 535504359.1542314.1475749343449.JavaMail.zimbra@heales.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-sql

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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bujji Babu 2016-10-06 10:23:12 Re: SQL Bug
Previous Message Kouber Saparev 2016-10-06 07:29:23 Re: BUG #14354: Wrong interpretation of JSON 'null'

Browse pgsql-sql by date

  From Date Subject
Next Message Bujji Babu 2016-10-06 10:23:12 Re: SQL Bug
Previous Message Andrey Avakimov 2016-10-04 13:36:59 Re: PLPython and named arguments