Re: [HACKERS] create function bug?

From: Brett McCormick <brett(at)work(dot)chicken(dot)org>
To: Ewan Mellor <em(at)nexus(dot)co(dot)uk>, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] create function bug?
Date: 1998-02-05 21:14:30
Message-ID: 199802052114.NAA00578@abraxas.scene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom 1998-02-05 21:48:10 Re: [HACKERS] create function bug?
Previous Message Bruce Momjian 1998-02-05 20:26:22 Re: [HACKERS] Profile of current backend (fwd)