Re: pg_dump - wrong order with inheritance
| От | pinker |
|---|---|
| Тема | Re: pg_dump - wrong order with inheritance |
| Дата | |
| Msg-id | 1448379287033-5874925.post@n5.nabble.com обсуждение исходный текст |
| Ответ на | Re: pg_dump - wrong order with inheritance (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: pg_dump - wrong order with inheritance
|
| Список | pgsql-bugs |
Tom Lane-2 wrote
> FWIW, the reason I'm doubtful of your wrong-dump-order diagnosis is
> that it's pretty hard to see how a not-null violation would arise
> that way. The subsequent complaints may only be consequences of
> that one.
i've just prepared test case and did some debugging. It turned out that the
issue isn't dump order but wrong ddl generated by pg_dump.
<pre>
CREATE TABLE a00
(
id INTEGER NOT NULL,
name TEXT NOT NULL,
CONSTRAINT a00_pkey PRIMARY KEY (id)
)
WITH (
OIDS =FALSE
);
CREATE TABLE a03
(
id INTEGER NOT NULL,
name TEXT NOT NULL,
CONSTRAINT a03_pkey PRIMARY KEY (id)
)
WITH (
OIDS =FALSE
);
ALTER TABLE a03
INHERIT a00;
ALTER TABLE a03
ALTER COLUMN name DROP NOT NULL;
</pre>
and now:
pg_dump testdump | psql testdump02
<pre>
COPY 0
ERROR: null value in column "name" violates not-null constraint
DETAIL: Failing row contains (1, null).
CONTEXT: COPY a03, line 1: "1 \N"
</pre>
so pg_dump is trying to create table a03 this way:
<pre>
CREATE TABLE a03 (
id integer,
name text
)
INHERITS (a00);
</pre>
and don't takes into account that column name has changed.
--
View this message in context: http://postgresql.nabble.com/pg-dump-wrong-order-with-inheritance-tp5874794p5874925.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
В списке pgsql-bugs по дате отправления: