Обсуждение: BUG #1159: server closed the connection unexpectedly

Поиск
Список
Период
Сортировка

BUG #1159: server closed the connection unexpectedly

От
"PostgreSQL Bugs List"
Дата:
The following bug has been logged online:

Bug reference:      1159
Logged by:          Ilya S. Slyzhnyak

Email address:      ilya@odt.east.telecom.kz

PostgreSQL version: 7.4

Operating system:   Linux

Description:        server closed the connection unexpectedly

Details:

Server closes connection, PostgreSQL 7.3.2 have same problem:
[postgres@localhost postgres]$ /usr/local/pgsql/bin/postmaster --version
postmaster (PostgreSQL) 7.4.2
[postgres@localhost postgres]$ /usr/local/pgsql/bin/psql -e -f test.sql test
CREATE TABLE inventory (
    invnum character(8) NOT NULL,
    description character(255)
);
CREATE TABLE
CREATE FUNCTION get_inventory(text) RETURNS inventory
    AS 'SELECT * FROM inventory WHERE invnum = $1;'
    LANGUAGE sql;
CREATE FUNCTION
CREATE TABLE test (
    inv inventory
);
CREATE TABLE
CREATE FUNCTION get_description(inventory) RETURNS character
    AS 'SELECT $1.description;'
    LANGUAGE sql;
CREATE FUNCTION
INSERT INTO inventory (invnum, description) VALUES (13172801, 'aaa');
INSERT 66300 1
INSERT INTO inventory (invnum, description) VALUES (13172802, 'bbb');
INSERT 66301 1
INSERT INTO test (inv) VALUES (get_inventory(13172801));
INSERT 66302 1
INSERT INTO test (inv) VALUES (get_inventory(13172802));
INSERT 66303 1
SELECT get_description(inv) FROM test;
psql:test.sql:24: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:test.sql:24: connection to server was lost

Re: BUG #1159: server closed the connection unexpectedly

От
Tom Lane
Дата:
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
> CREATE TABLE inventory (
>     invnum character(8) NOT NULL,
>     description character(255)
> );

> CREATE TABLE test (
>     inv inventory
> );

Table columns can't be composite types.  It's possible this will work in
7.5, if anyone does more work on it in the next month, but it hasn't
worked since Berkeley days.  (And the feature they had didn't work as
you expect, either.)

            regards, tom lane