Skip site navigation (1) Skip section navigation (2)

Array access to type "name"

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Array access to type "name"
Date: 2003-04-26 21:07:17
Message-ID: Pine.LNX.4.44.0304261957280.2138-100000@peter.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackers
The type "name" can be subscripted like an array to access the individual
"char" elements.  But since a character stored in a "name" value isn't
necessarily one byte, this is incorrect.  Does anything rely on this
facility, or would it be better to remove it for type "name"?

Here's an example that produces a failure:

$ export PGCLIENTENCODING=latin1
$ createdb -E UNICODE test
$ psql test
=> create table Ă¥land (a int);
=> create table Ă¼berschall (b int);
=> select relname[0] from pg_class;
ERROR:  Could not convert UTF-8 to ISO8859-1

-- 
Peter Eisentraut   peter_e(at)gmx(dot)net


Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-04-26 21:17:45
Subject: Re: [EXAMPLE] Overly zealous security of schemas...
Previous:From: Sean ChittendenDate: 2003-04-26 20:48:23
Subject: [EXAMPLE] Overly zealous security of schemas...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group