Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 83B766323AA for ; Sun, 6 Jun 2010 04:19:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 33611-02 for ; Sun, 6 Jun 2010 07:19:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id 67FE863249F for ; Sun, 6 Jun 2010 04:19:00 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LtBsd-1PHp9d3rLP-01277P; Sun, 06 Jun 2010 09:18:59 +0200 Message-ID: <4C0B4BE1.9060001@2ndquadrant.com> Date: Sun, 06 Jun 2010 03:18:57 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: pgsql-docs@postgresql.org Subject: Special column trivia Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18f07W547TpkbNemwHOy2NS3WefbJ0TtYZwpSR Aw1JI1hWe+H0bXN/KxvynRSCisZohx6WRGNZb1RaqOrwr5QRrq 952VACkyAdFgft06FCgiMHI0eg/ATFi X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-5 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/6 X-Sequence-Number: 5574 I was just reading http://www.postgresql.org/docs/9.0/static/ddl-system-columns.html and noted that the second part about the ctid being unstable: "a row's ctid will change if it is updated or moved by VACUUM FULL" is probably not true anymore. Is that worth updating? What got me reading that section was a rather weird documentation question/addition from Edmund Horner. He noted that the following works on PG8.4 and 9.0: postgres=# select (row(1,2)).name; name ------- (1,2) Having not worked on earlier versions (this from 8.3): postgres=# select (row(1,2)).name; ERROR: could not identify column "name" in record data type I didn't see anything that documents the ability to use "name" to refer to the composite record like this. Since it's not an area of the code I'm familiar with, so I'm just baffled as Edmund. "Row Constructors" at http://www.postgresql.org/docs/current/interactive/sql-expressions.html and "Composite Value Input" at http://www.postgresql.org/docs/current/interactive/rowtypes.html both seem relevant, but don't seem to explain what's happening. That second one is where he pointed out confusion can really creep in, because "name" is also a field in the inventory_item table, which makes it particularly easy for a coding error to refer to the wrong thing oddly. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us