some strange bugs related to upgrade from 8.1 to 8.3

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "postgres hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: some strange bugs related to upgrade from 8.1 to 8.3
Date: 2008-11-04 15:22:17
Message-ID: 162867790811040722u61db7161g49cace42508b7cfa@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I started upgrade our databases from 8.1 to 8.3. I found two strange
bugs related to tsearch2.

a) server crash after creating tsearch2 function (I use tsearch2
contrib from 8.3)
(gdb) bt
#0 0x0000003838033075 in raise () from /lib64/libc.so.6
#1 0x0000003838034be3 in abort () from /lib64/libc.so.6
#2 0x000000000068db5d in ExceptionalCondition (conditionName=<value
optimized out>, errorType=<value optimized out>, fileName=<value
optimized out>, lineNumber=<value optimized out>) at assert.c:57
#3 0x0000000000a6cc79 in plpgsql_HashTableInit () at pl_comp.c:2016
#4 0x0000000000e95d72 in _PG_init () from /usr/lib64/pgsql/plpgsql.so
#5 0x0000000000693105 in internal_load_library (libname=0x1fd5c70
"/usr/lib64/pgsql/plpgsql.so") at dfmgr.c:296
#6 0x0000000000693506 in load_external_function (filename=<value
optimized out>, funcname=0x1fa8358 "plpgsql_call_handler",
signalNotFound=1 '\001', filehandle=0x7fff8eb5d678) at dfmgr.c:110
#7 0x00000000004bd1b9 in fmgr_c_validator (fcinfo=<value optimized
out>) at pg_proc.c:509
#8 0x00000000006964e6 in OidFunctionCall1 (functionId=<value
optimized out>, arg1=28155) at fmgr.c:1532
#9 0x00000000004bdab0 in ProcedureCreate (procedureName=0x1f6a430
"plpgsql_call_handler", procNamespace=2200, replace=0 '\0',
returnsSet=0 '\0', returnType=2280, languageObjectId=13,
languageValidator=2247, prosrc=0x1f6a640 "plpgsql_call_handler",
probin=0x1f6a608 "/usr/lib64/pgsql/plpgsql", isAgg=0 '\0',
security_definer=0 '\0', isStrict=0 '\0', volatility=118 'v',
parameterTypes=0x1fa7a90, allParameterTypes=0, parameterModes=0,
parameterNames=0, proconfig=0, procost=1, prorows=0) at pg_proc.c:413
#10 0x0000000000502588 in CreateFunction (stmt=0x1f6a890) at functioncmds.c:785
#11 0x00000000005e3da5 in PortalRunUtility (portal=0x1fc3678,
utilityStmt=0x1f6a890, isTopLevel=-1 '�', dest=0x1f6a948,
completionTag=0x7fff8eb5e020 "") at pquery.c:1173
#12 0x00000000005e53d5 in PortalRunMulti (portal=0x1fc3678,
isTopLevel=<value optimized out>, dest=0x1f6a948, altdest=0x1f6a948,
completionTag=0x7fff8eb5e020 "") at pquery.c:1266
#13 0x00000000005e5c1b in PortalRun (portal=0x1fc3678,
count=9223372036854775807, isTopLevel=64 '@', dest=0x1f6a948,
altdest=0x1f6a948, completionTag=0x7fff8eb5e020 "") at pquery.c:813
#14 0x00000000005e0a0c in exec_simple_query (
query_string=0x1f69ae8 "CREATE FUNCTION plpgsql_call_handler()
RETURNS language_handler\n AS '/usr/lib64/pgsql/plpgsql',
'plpgsql_call_handler'\n LANGUAGE c;") at postgres.c:986
#15 0x00000000005e1f67 in PostgresMain (argc=4, argv=<value optimized
out>, username=0x1ed56a8 "pavel") at postgres.c:3572
#16 0x00000000005ae96a in BackendRun () at postmaster.c:3207
#17 BackendStartup () at postmaster.c:2830
#18 ServerLoop () at postmaster.c:1274
#19 0x00000000005af685 in PostmasterMain (argc=3, argv=0x1ed1540) at
postmaster.c:1029
#20 0x000000000055f208 in main (argc=3, argv=0x1ed1540) at main.c:188
(gdb)

ERROR: function public.lexize(text) does not exist
STATEMENT: ALTER FUNCTION public.lexize(text) OWNER TO postgres;
ERROR: could not find function "parse" in file
"/usr/local/pgsql8.3/lib/tsearch2.so"
STATEMENT: CREATE FUNCTION parse(oid, text) RETURNS SETOF tokenout
<------> AS '$libdir/tsearch2', 'parse'
<------> LANGUAGE c STRICT;
ERROR: function public.parse(oid, text) does not exist
STATEMENT: ALTER FUNCTION public.parse(oid, text) OWNER TO postgres;
ERROR: could not find function "parse_byname" in file
"/usr/local/pgsql8.3/lib/tsearch2.so"
STATEMENT: CREATE FUNCTION parse(text, text) RETURNS SETOF tokenout
<------> AS '$libdir/tsearch2', 'parse_byname'
<------> LANGUAGE c STRICT;
ERROR: function public.parse(text, text) does not exist
STATEMENT: ALTER FUNCTION public.parse(text, text) OWNER TO postgres;
ERROR: could not find function "parse_current" in file
"/usr/local/pgsql8.3/lib/tsearch2.so"
STATEMENT: CREATE FUNCTION parse(text) RETURNS SETOF tokenout
<------> AS '$libdir/tsearch2', 'parse_current'
<------> LANGUAGE c STRICT;
ERROR: function public.parse(text) does not exist
STATEMENT: ALTER FUNCTION public.parse(text) OWNER TO postgres;
TRAP: FailedAssertion("!(plpgsql_HashTable == ((void *)0))", File:
"pl_comp.c", Line: 2016)
LOG: server process (PID 4672) was terminated by signal 6: Aborted
LOG: terminating any other active server processes
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted; last known up at 2008-11-04 15:01:14 CET
LOG: database system was not properly shut down; automatic recovery in progress

b) after instalation tsearch2 (8.3) postgresql knows tsvector type

template1=# select 'tsvector'::regtype;
regtype
----------
tsvector
(1 row)

template1=# create table foo(a tsvector);
CREATE TABLE
template1=#

but inside import pg should forget this type and use tsvector only as shell type

ERROR: type "tsvector" is only a shell
STATEMENT: CREATE TYPE tsdebug AS (
<------><------>ts_name text,
<------><------>tok_type text,
<------><------>description text,
<------><------>token text,
<------><------>dict_name text[],
<------><------>tsvector tsvector
<------>);
ERROR: type "public.tsdebug" does not exist
STATEMENT: ALTER TYPE public.tsdebug OWNER TO postgres;
NOTICE: argument type tsvector is only a shell
STATEMENT: CREATE FUNCTION concat(tsvector, tsvector) RETURNS tsvector
<------> AS '$libdir/tsearch2', 'concat'
<------> LANGUAGE c IMMUTABLE STRICT;
NOTICE: argument type tsvector is only a shell
STATEMENT: CREATE FUNCTION concat(tsvector, tsvector) RETURNS tsvector
<------> AS '$libdir/tsearch2', 'concat'

in this moment we cannot do tables
ERROR: type "tsvector" is only a shell at character 1274
STATEMENT: CREATE TABLE "position" (CREATE TYPE tsvector;

<------> id integer NOT NULL,
<------> title character varying(255) NOT NULL,
<------> description text,
<------> work_address character varying(255),
<------> reward character varying(100),
<------> time_info character varying(100),
<------> work_type character varying(80),
<------> date_enter integer NOT NULL,
<------> date_expire integer NOT NULL,
<------> date_expire_original integer NOT NULL,
<------> id_status integer NOT NULL,
<------> submitter_name character varying(50),
<------> submitter_email character varying(80),
<------> submitter_phone character varying(50),
<------> uniq_key character varying(55),
<------> id_svl_work_kind character(3),
<------> submitter_ip character varying(40),
<------> source character(1),
<------> target character varying(2) NOT NULL,
<------> iswarranty character(1),
<------> url_pdjd character varying(255),
<------> g2_id integer,
<------> rejection_description text,
<------> g2_id_personnel integer,
<------> g2_id_company integer,
<------> contact_company_name character varying(100),
<------> contact_company_info character varying(255),
<------> contact_person character varying(50),
<------> contact_phone character varying(50),
<------> contact_email character varying(80),
<------> contact_address character varying(255),
<------> date_enter_modified integer,
<------> ispaid character(1) DEFAULT 0,
<------> date_enter_touched integer,
<------> fulltext_index tsvector
<------>);

build script is in attachement, log too

Attachment Content-Type Size
db05.sql text/x-sql 12.7 KB
log.txt text/plain 5.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-11-04 15:32:32 Re: Transactions and temp tables
Previous Message Tom Lane 2008-11-04 15:22:03 Re: libpq and sslmode=require