Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQ870-0004Am-Dt for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2015 05:32:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YQ86z-0001r8-S9 for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2015 05:32:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YQ86y-0001r1-P5 for pgsql-bugs@postgresql.org; Tue, 24 Feb 2015 05:32:48 +0000 Received: from linode.thelabyrinth.net ([2600:3c00::f03c:91ff:fe69:8d76] helo=mail.thelabyrinth.net) by makus.postgresql.org with esmtps (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YQ86r-00042e-Kp for pgsql-bugs@postgresql.org; Tue, 24 Feb 2015 05:32:47 +0000 Received: from theseus.local (c-50-186-230-40.hsd1.fl.comcast.net [50.186.230.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id AE7DF12D2D; Tue, 24 Feb 2015 05:32:36 +0000 (UTC) Message-ID: <54EC0CEE.7000707@pgmasters.net> Date: Tue, 24 Feb 2015 00:32:30 -0500 From: David Steele User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Michael Paquier , Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: View restore error in 9.3-9.4 upgrade References: <54EBA91C.1020907@pgmasters.net> <19351.1424742224@sss.pgh.pa.us> In-Reply-To: OpenPGP: id=A2739CF3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3cHo24oKFJ6a6tr2qXixD5HLwnsojMN5e" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3cHo24oKFJ6a6tr2qXixD5HLwnsojMN5e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2/23/15 8:57 PM, Michael Paquier wrote: > On Tue, Feb 24, 2015 at 10:43 AM, Tom Lane > wrote: >=20 > 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) >=20 > (that's not what you wrote originally, but ruleutils.c prints all t= he > 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. >=20 >=20 > 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. --=20 - David Steele david@pgmasters.net --3cHo24oKFJ6a6tr2qXixD5HLwnsojMN5e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU7AzuAAoJEIA2uIJQ5SFAyyQP/RoI0r1js9lPrlCSTCCUctZD rQQ+dmom5uLO47hIlQde8/B0jTSqyXR4sJVvAhV2PWjPzQ9pqFWydG8H/NBWE7hm AgDlFqwR8e2yFl3jTvQdYg9clwZQ4e+ik+E2Ei4oZiqeAtlCpwm3WE9fA+/ikESg rDIL1s/YDy5+WyZxA25+2pPtgwwxqEMB7snu1DixYtyS/Glb8UmO4zYtP3LYX4ev NAuHQQ9ZHyPzo7B2OHNFJVi1ug8wO85CTTSEz1w7fS0rbSzm/gem/rFOxs5rsFuq D3dW15HKnlbWDVy9oKBSJ4qSl9cs8itHw7fF36jkbdd97gA+oo6BTw5/DglM8Uo2 Mg8HSOJ9ZXVxKuaGMoiSV7XlZ3L6KFQpUuhcPB3EWaRN0mS+JLNuTbez0Icn19jU cX3F+gwwBObRkXHlbXLyXpu2nMyLcIYxbNUuOmvx1TDiP/JjXJ7s31iiXE+qm8MO xbdGaWIiMeZBYvq0jphkp2kv9mYyTjugMIBYZoMflNkvjeWTngvTExa2n4IlIkmv x1azMgcHBy1Nosp7B77X+9MuIQFHgG7fXuYUzfc7QG0CE/7w79Ire6HB5ECyX08z AYXeYUKPJ/lSj3RaYLu1BEQuMSjgXIU79se/5tnSow0RDzSzAlLxrTXfwLNpAFDt tA0Bdk6sr2Re4wrcNoI7 =SoEo -----END PGP SIGNATURE----- --3cHo24oKFJ6a6tr2qXixD5HLwnsojMN5e--