When do we lose column names?

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: When do we lose column names?
Date: 2011-11-16 20:58:31
Message-ID: 12858.208.226.76.25.1321477111.squirrel@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Consider the following query:

select (x).key as k, (x).value as v
from (select each(hstore(q)) as x
from (select oid, c.*
from pg_class c
where oid = 'parent'::regclass) q) t;

This gives results like this:

k | v
-----+--------
f1 | 16410
f2 | parent
f3 | 2200
f4 | 16412
f5 | 0
f6 | 10
....

Now add a limit clause to the innermost query:

select (x).key as k, (x).value as v
from (select each(hstore(q)) as x
from (select oid, c.*
from pg_class c
where oid = 'parent'::regclass
limit 99999999) q) t;

Now the result looks like this:

k | v
----------------+--------
oid | 16410
relam | 0
relacl |
relkind | r
relname | parent
reltype | 16412

What I'm having difficulty understanding is why the limit clause should
make any difference.

Is this a bug? If not, is it documented.

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Mead 2011-11-16 21:09:54 Re: IDLE in transaction introspection
Previous Message Robert Haas 2011-11-16 20:42:07 Re: Minor optimisation of XLogInsert()