Re: table schema causes crash - Mailing list pgsql-general

From
Subject Re: table schema causes crash
Date
Msg-id 2341.63.226.186.156.1040412468.squirrel@www.minnesota.com
Whole thread Raw
In response to Re: table schema causes crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: table schema causes crash
List pgsql-general
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> I just tried with the CVS current and don't see a crash.  I don't see
>> anything fancy in there at all.
>
> Works for me in 7.2.3, as well.
>
> How about a stack trace, platform details, etc?

it segmentation faults but didn't core dump. postmaster is still running
though, so maybe psql segmentation fault.

# uname -a
NetBSD ns01 1.6 NetBSD 1.6 (ns01-1.6) #1: Mon Nov 25 17:03:01 CST 2002
root@ns01:/usr/s
rc/1.6/sys/arch/alpha/compile/ns01-1.6 alpha

I tried creating a test table and it suceeded w/o any problems:

create table testtable (
    col_1 varchar(64) primary key,
    col_2 varchar(32),
    col_3 int
);

---

authtest=# create table testtable (
authtest(#      col_1 varchar(64) primary key,
        col_2 varchar(32),
        col_3 int
);col_1 varchar(64) primary key,
authtest(# col_2 varchar(32),
authtest(# col_3 int
authtest(# );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'testtable_pkey' for table '
testtable'
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'testtable_pkey' for table '
testtable'
CREATE
authtest=# \d testtable
               Table "testtable"
 Column |         Type          |  Modifiers
--------+-----------------------+--------------
 col_1  | character varying(64) | col_3 int
 col_2  | character varying(32) | \d testtable
 col_3  | integer               | testtable
Primary key: testtable_pkey

authtest=#

---
*** NOTE \d worked above for testtable ****

then i tried creating the other table that caused it to crash again:

---

authtest=# CREATE TABLE imap_passwd (
authtest(#         username              varchar(128) NOT NULL PRIMARY KEY,
        pw_crypt              varchar(128) DEFAULT '' NOT NULL,
        pw_clear              varchar(128) DEFAULT '' NOT NULL,
        real_name             varchar(128) DEFAULT ''        username
        varchar(
128) NOT NULL PRIMARY KEY,
authtest(#         pw_crypt              varchar(128) DEFAULT '' NOT NULL,
authtest(#         pw_clear              varchar(128) DEFAULT '' NOT NULL,
authtest(#         real_name             varchar(128) DEFAULT '' NOT NULL,
authtest(#         user_id               int NOT NULL,
authtest(#         group_id              int NOT NULL,
authtest(#         home                  varchar(255) DEFAULT '' NOT NULL,
authtest(#         maildir               varchar(255) DEFAULT '' NOT NULL,
authtest(#         quota                 varchar(255) DEFAULT '' NOT NULL
authtest(# );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'imap_passwd_pkey' for table
 'imap_passwd'
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'imap_passwd_pkey' for table
 'imap_passwd'
CREATE
authtest=# \d testtable
DEBUG:  pq_recvbuf: unexpected EOF on client connection
Segmentation fault
$ psql authtest
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

authtest=# \d testtable
             Table "testtable"
 Column |         Type          | Modifiers
--------+-----------------------+-----------
 col_1  | character varying(64) | Primary key: testtable_pkey

*** NOTE THE OTHER MISSING COLUMNS ***

authtest=# \d imap_passwd
              Table "imap_passwd"
  Column  |          Type          | Modifiers
----------+------------------------+-----------
 username | character varying(128) | Primary key: imap_passwd_pkey

authtest=# drop table imap_passwd;
DROP
authtest=# \d testtable;
             Table "testtable"
 Column |         Type          | Modifiers
--------+-----------------------+-----------
 col_1  | character varying(64) | Primary key: testtable_pkey

authtest=# drop table testtable;
DROP

----

as you can see the creation of table imap_passwd causes psql to
segmentation fault and causes the odd effect of '\d' command.



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: table schema causes crash
Next
From: Tom Lane
Date:
Subject: Re: table schema causes crash