pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Michael Paquier <michael.paquier@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: View restore error in 9.3-9.4 upgrade
Date: Tue, 24 Feb 2015 00:32:30 -0500
Message-ID: <54EC0CEE.7000707@pgmasters.net> (raw)
In-Reply-To: <CAB7nPqRHAw-akq2WtFq-0uTzcS79CsXYEnBnnsn98Nvoof4Hng@mail.gmail.com>
References: <54EBA91C.1020907@pgmasters.net>
	<19351.1424742224@sss.pgh.pa.us>
	<CAB7nPqRHAw-akq2WtFq-0uTzcS79CsXYEnBnnsn98Nvoof4Hng@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2/23/15 8:57 PM, Michael Paquier wrote:
> On Tue, Feb 24, 2015 at 10:43 AM, Tom Lane <tgl@sss.pgh.pa.us
> <mailto:tgl@sss.pgh.pa.us>> wrote:
> 
>        FROM process_list() pg_stat_activity(datid, datname, pid,
>     usesysid, usename, application_name, client_addr, client_hostname,
>     client_port, backend_start, xact_start, query_start, state_change,
>     waiting, state, query)
> 
>     (that's not what you wrote originally, but ruleutils.c prints all the
>     known column aliases not just what you wrote).  So everything up to
>     "state" matches, but then "query" is assigned as the alias for
>     "backend_xid", while "backend_xmin" and "query" remain unaliased.
>     And now you have two columns named "query" in that FROM-item.
> 
> 
> One quick-and-dirty way you could use to avoid the error would be to
> complete the alias list to map the new columns backend_xid and
> backend_xmin, like that:
>    FROM process_list() pg_stat_activity(datid, datname, pid, usesysid,
> usename, application_name, client_addr, client_hostname, client_port,
> backend_start, xact_start, query_start, state_change, waiting, state,
> backend_xid, backend_xmin, query)

Sure - that would definitely work.  Not too much fun to change on a
multi-gig file, though.

I'll just chalk this one up to a lesson learned - never use system row
types as they are subject to change.

-- 
- David Steele
david@pgmasters.net

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (9+ messages)

Message-ID: <54EC0CEE.7000707@pgmasters.net>
Permalink:  ../54EC0CEE.7000707@pgmasters.net/
Also on:    postgresql.org/message-id/54EC0CEE.7000707@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david@pgmasters.net, michael.paquier@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: View restore error in 9.3-9.4 upgrade
  In-Reply-To: <54EC0CEE.7000707@pgmasters.net>
  References: <54EBA91C.1020907@pgmasters.net> <19351.1424742224@sss.pgh.pa.us> <CAB7nPqRHAw-akq2WtFq-0uTzcS79CsXYEnBnnsn98Nvoof4Hng@mail.gmail.com> <54EC0CEE.7000707@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox