On Fri, Jan 2, 2015 at 9:59 PM, Jeff Janes <jeff.ja...@gmail.com> wrote:

> On Mon, Dec 29, 2014 at 2:15 PM, Alvaro Herrera <alvhe...@2ndquadrant.com>
> wrote:
>
>> Here's a patch that tweaks the grammar to use TypeName in COMMENT,
>> SECURITY LABEL, and DROP for the type and domain cases.  The required
>> changes in the code are pretty minimal, thankfully.  Note the slight
>> changes to the new object_address test also.
>>
>> I think I'm pretty much done with this now, so I intend to push this
>> first thing tomorrow and then the rebased getObjectIdentityParts patch
>> sometime later.
>>
>
>
> This commit 3f88672a4e4d8e648d24ccc65 seems to have broken pg_upgrade for
> pg_trgm.
>
> On 9.2.9 freshly initdb and started with default config:
>
> $ createdb jjanes
>
> in psql:
>
> create extension pg_trgm ;
> create table foo (x text);
> create index on foo using gin (upper(x) gin_trgm_ops);
>
> Then run 9.5's pg_upgrade and it fails at the stage of restoring the
> database schema.
>
>
The problem also occurs doing a self-upgrade from 9.5 to 9.5.

The contents of the dump not changed meaningfully between 9.4 and 9.5.
I've isolated the problem to the backend applying the pg_restore of the
dump, regardless of which version created the dump.

After compiling  3c9e4cdbf2ec876dbb7 with CFLAGS="-fno-omit-frame-pointer",
I get this backtrace for the core-dump of postmaster during the pg_restore:



Core was generated by `postgres: jjanes jjanes [local] ALTER EXTENSION
                          '.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000005135ff in NameListToString (names=0x257fcf8) at
namespace.c:2935
2935                    if (IsA(name, String))
(gdb) bt
#0  0x00000000005135ff in NameListToString (names=0x257fcf8) at
namespace.c:2935
#1  0x0000000000512f33 in DeconstructQualifiedName (names=0x257fcf8,
nspname_p=0x7fff419bc960, objname_p=0x7fff419bc958) at namespace.c:2648
#2  0x000000000058a746 in LookupTypeName (pstate=0x0, typeName=0x257fd10,
typmod_p=0x0, missing_ok=0 '\000') at parse_type.c:153
#3  0x00000000005220b4 in get_object_address_type (objtype=OBJECT_TYPE,
objname=0x257fd50, missing_ok=0 '\000') at objectaddress.c:1306
#4  0x0000000000520cf5 in get_object_address (objtype=OBJECT_TYPE,
objname=0x257fd50, objargs=0x0, relp=0x7fff419bcb58, lockmode=4,
missing_ok=0 '\000')
    at objectaddress.c:678
#5  0x00000000005c0f36 in ExecAlterExtensionContentsStmt (stmt=0x257fd80)
at extension.c:2906
#6  0x000000000077508c in ProcessUtilitySlow (parsetree=0x257fd80,
    queryString=0x254f990 "\n-- For binary upgrade, must preserve pg_type
oid\nSELECT
binary_upgrade.set_next_pg_type_oid('16394'::pg_catalog.oid);\n\n\n-- For
binary upgrade, must preserve pg_type array oid\nSELECT binary_upgrade.se"...,
context=PROCESS_UTILITY_QUERY, params=0x0, dest=0x2581b60,
    completionTag=0x7fff419bd100 "") at utility.c:1167
#7  0x000000000077490e in standard_ProcessUtility (parsetree=0x257fd80,
    queryString=0x254f990 "\n-- For binary upgrade, must preserve pg_type
oid\nSELECT
binary_upgrade.set_next_pg_type_oid('16394'::pg_catalog.oid);\n\n\n-- For
binary upgrade, must preserve pg_type array oid\nSELECT binary_upgrade.se"...,
context=PROCESS_UTILITY_QUERY, params=0x0, dest=0x2581b60,
    completionTag=0x7fff419bd100 "") at utility.c:840
#8  0x0000000000773bcc in ProcessUtility (parsetree=0x257fd80,
    queryString=0x254f990 "\n-- For binary upgrade, must preserve pg_type
oid\nSELECT
binary_upgrade.set_next_pg_type_oid('16394'::pg_catalog.oid);\n\n\n-- For
binary upgrade, must preserve pg_type array oid\nSELECT binary_upgrade.se"...,
context=PROCESS_UTILITY_QUERY, params=0x0, dest=0x2581b60,
    completionTag=0x7fff419bd100 "") at utility.c:313
#9  0x0000000000772dd6 in PortalRunUtility (portal=0x2505b90,
utilityStmt=0x257fd80, isTopLevel=0 '\000', dest=0x2581b60,
completionTag=0x7fff419bd100 "")
    at pquery.c:1187
#10 0x0000000000772f8c in PortalRunMulti (portal=0x2505b90, isTopLevel=0
'\000', dest=0x2581b60, altdest=0x2581b60, completionTag=0x7fff419bd100 "")
    at pquery.c:1318
#11 0x0000000000772560 in PortalRun (portal=0x2505b90,
count=9223372036854775807, isTopLevel=0 '\000', dest=0x2581b60,
altdest=0x2581b60,
    completionTag=0x7fff419bd100 "") at pquery.c:816
#12 0x000000000076c868 in exec_simple_query (
    query_string=0x254f990 "\n-- For binary upgrade, must preserve pg_type
oid\nSELECT
binary_upgrade.set_next_pg_type_oid('16394'::pg_catalog.oid);\n\n\n-- For
binary upgrade, must preserve pg_type array oid\nSELECT binary_upgrade.se"...)
at postgres.c:1045
#13 0x00000000007708a2 in PostgresMain (argc=1, argv=0x24ed5e0,
dbname=0x24ed4b8 "jjanes", username=0x24ed4a0 "jjanes") at postgres.c:4012
#14 0x0000000000701940 in BackendRun (port=0x250c1b0) at postmaster.c:4130
#15 0x0000000000701083 in BackendStartup (port=0x250c1b0) at
postmaster.c:3805
#16 0x00000000006fd8c5 in ServerLoop () at postmaster.c:1573
#17 0x00000000006fd013 in PostmasterMain (argc=18, argv=0x24ec480) at
postmaster.c:1220
#18 0x000000000066476b in main (argc=18, argv=0x24ec480) at main.c:220

Cheers,

Jeff

Reply via email to