Error message that is a bit misleading / weird result from <xid> || null

From: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Error message that is a bit misleading / weird result from <xid> || null
Date: 2007-06-22 13:01:11
Message-ID: 200706221501.12227.ftm.van.vugt@foxi.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

While trying to find a way to get indexed access to a table based on it's
xmin, I ran into the following error message that seems a bit misleading:

db=# select xmin || ' ' from <anytable> limit 1;
ERROR: array value must start with "{" or dimension information

Toying a bit more with this result resulted in:

megafox=# select xmin || null from <anytable> limit 1;
?column?
------------
{12115328}
(1 row)

As it seems, the result is actually a correct array:

db=# select (xmin || null)[1] from <anytable> limit 1;
?column?
----------
12115328
(1 row)

And comparing the result to for example an int, works.

Now I understand that there are no standard casts of xid to something else,
but the interpretation if this concatenation surprised at least me ;)

Sidenote: since it does solve my problem, I can now build an index based on
such an interpretation of xmin, I'm a bit anxious as to how this will
be 'fixed', if at all ;)

db=# select version();
version
------------------------------------------------------------------------
PostgreSQL 8.2.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3
(1 row)

--
Best,

Frank.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Frank van Vugt 2007-06-22 13:08:26 Error message that is a bit misleading / weird result from <xid> || null
Previous Message Zdenek Kotala 2007-06-22 12:19:06 Re: BUG #3403: ver 8.2 can't add serial column to temp table,but 8.1 can