Re: Fwd: [GENERAL] returning CHAR from C function

From: elein <elein(at)sbcglobal(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, elein(at)varlena(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Fwd: [GENERAL] returning CHAR from C function
Date: 2002-12-03 00:26:54
Message-ID: 200212022326.gB2NQfE9580938@pimout1-ext.prodigy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Thanks. This is helpful. The only inconsistency
on the postgresql side is the PG_RETURN_CHAR which does return
the one character, not the bpchar. Perhaps a PG_RETURN_CHAR1
or PG_RETURN_CHAR_REALLY would help. I think the only people
who would get caught with it as it is are those writing C functions to return
one character chars, so obviously documentation should be able
to solve the inconsistency as well.

elein

On Sunday 01 December 2002 16:54, Tom Lane wrote:
> elein <elein(at)sbcglobal(dot)net> writes:
> > I think I do not know the background on this.
>
> I think it's mostly historical. The one-byte "char" datatype seems to
> date back to Berkeley days, long before there was any concern for SQL
> compliance (it's there in Postgres 4.2). "bpchar" was apparently added
> in Postgres95 in order to provide SQL-like functionality --- but they
> didn't pay any attention to duplicating the SQL name for it. The
> keyword CHARACTER was added later, translating it to the internal name
> bpchar in the parser. Eventually the keyword CHAR was added too, and
> translated.
>
> The real question at this point is what would break if we renamed "char"
> to "char1". Since it's used extensively in the system catalogs, I'm
> sure there would be some unhappiness involved. I am dubious that
> merely avoiding confusion is a sufficient reason to change.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
----------------------------------------------------------------------------------------
elein(at)varlena(dot)com Database Consulting www.varlena.com
I have always depended on the [QA] of strangers.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-12-03 01:25:31 Bug #833: prep_buildtree and solaris ln
Previous Message Peter Mount 2002-12-02 10:49:20 bug in vacuumlo (postgreSQL-7.3)? (fwd)