Re: [HACKERS] create function bug?
От | Brett McCormick |
---|---|
Тема | Re: [HACKERS] create function bug? |
Дата | |
Msg-id | 199802052114.NAA00578@abraxas.scene.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] create function bug? (Brett McCormick <brett@work.chicken.org>) |
Список | pgsql-hackers |
After going over the grammer and function code, there's a little bit of weirdness I see. I don't know the correct terminology, but the grammer for typname is a little odd. in the first case (i.e. txname) it does some type translating itself (flort => float8, decimal => integer, numeric => integer) before calling xlateSqlType, which does the same thing, but with the following types: (int/integer => int4, smalling => int2, real => float8, interval => timespan) in the second case (SETOF txname), none of this pre-xlateSqlType translating is done. is it safe to assume someone put this code in the wrong place (not in xlateSqlType so it would apply to all types)? is the grammar the best place for this "type aliasing"? would it be safe to modify the create function grammer to call xlateSqlType (so long as opaque does not get aliased to anything? ;) --brett > On Thu, 5 February 1998, at 17:00:15, Ewan Mellor wrote: > > > Using a snapshot from two days ago on a i586-pc-linux-gnu using > > linux-elf template: > > > > test=> create table test (t1 integer); > > CREATE > > test=> create function myfunc (integer) returns integer > > test-> as 'select $1' language 'sql'; > > ERROR: ProcedureCreate: arg type 'integer' is not defined > > test=> create function myfunc(int4) returns int4 > > test-> as 'select $1' language 'sql'; > > CREATE > > > > I can use the integer type in tables, but not in functions. Is this a > > bug? > > > > Ewan Mellor.
В списке pgsql-hackers по дате отправления: