Re: input/output functions have been changed ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: input/output functions have been changed ?
Date: 2000-06-15 03:42:45
Message-ID: 17184.961040565@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
> I just want to confirm if input/output functions have
> been changed.

> select int4out(1);
> int4out
> -----------
> 136475032
> (1 row)

Sure, you expected something nicer? You're seeing the numeric
representation of a C string pointer.

Actually, checking 6.5, I see that int4out --- alone of all the *out
functions --- used to be declared in pg_proc to return type 'name'.
All the other ones are declared to return type 'int4', which means if
you invoke them explicitly as in the above example, you'll see the
numeric equivalent of whatever pointer value they return.

'name' is not a correct declaration either since it implies a string
of < NAMEDATALEN chars, but it would have happened to produce the right
sort of results.

I changed int4out to be the same as the other *out functions recently,
just for consistency's sake. Really the right fix is to assign a real
type OID to represent "C string" so that the argument and return types
of input/output functions can be declared honestly. We've talked about
that before, and I've been thinking about making a concrete proposal
for it, but haven't done anything yet...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2000-06-15 04:15:22 Re: Big 7.1 open items
Previous Message Bruce Momjian 2000-06-15 03:21:15 Re: Big 7.1 open items