dbTalk Databases Forums  

[BUGS] The comment sentence of Primary-Key is lost.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] The comment sentence of Primary-Key is lost. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hiroshi Saito
 
Posts: n/a

Default [BUGS] The comment sentence of Primary-Key is lost. - 09-19-2003 , 09:19 AM






Hi all.

My comment sentence of Primary-Key is lost.!

See this sample below.
---------------------------------------------------------------
CREATE TABLE "MyTransaction"
(
"XID" int4 NOT NULL,
"LastSeqId" int4 NOT NULL,
"HostId" int4 NOT NULL,
CONSTRAINT "MyTransaction_pkey" PRIMARY KEY ("XID", "HostId")
) WITH OIDS;
COMMENT ON CONSTRAINT "MyTransaction_pkey" ON "MyTransaction" IS 'What happens to this?';

----------------------------------------------------------------
saito=# SELECT cls.oid, cls.relname as idxname, indrelid, indkey, indisclustered, indisunique,
indisprimary, n.nspname, indnatts, tab.relname as tabname, indclass, description,
pg_get_expr(indpred, indrelid, true) as indconstraint, contype, condeferrable, condeferred, amname
FROM pg_index idx
JOIN pg_class cls ON cls.oid=indexrelid
JOIN pg_class tab ON tab.oid=indrelid
JOIN pg_namespace n ON n.oid=tab.relnamespace
JOIN pg_am am ON am.oid=cls.relam
LEFT OUTER JOIN pg_description des ON (des.objoid=cls.oid AND des.objsubid = 0)
LEFT OUTER JOIN pg_constraint con ON con.conrelid=indrelid AND conname=cls.relname
WHERE cls.relname = 'MyTransaction_pkey';

oid | idxname | indrelid | indkey | indisclustered | indisunique | indisprimary | nspname | indnatts | tabname
Quote:
indclass | description | indconstraint | contype | condeferrable | condeferred | amname
--------+--------------------+----------+--------+----------------+-------------+--------------+---------+----------+-----------
----+-----------+-------------+---------------+---------+---------------+-------------+--------
518874 | MyTransaction_pkey | 518872 | 1 3 | f | t | t | saito | 2 |
MyTransaction | 1978 1978 | | | p | f | f | btree
(1 row)

*Why?*

saito=# SELECT * FROM pg_description WHERE objoid >= 518874::OID;
objoid | classoid | objsubid | description
--------+----------+----------+-----------------------
518875 | 16386 | 0 | What happens to this?
(1 row)

Hmm... 518875?
Do I have misunderstanding?
However,
pg_dumpall that all is supposed to be extracted after this result loses this.
As for this cause, something isn't known.

Any comment?

Regards,
Hiroshi Saito


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] The comment sentence of Primary-Key is lost. - 09-19-2003 , 06:18 PM






"Hiroshi Saito" <saito (AT) inetrt (DOT) skcapi.co.jp> writes:
Quote:
My comment sentence of Primary-Key is lost.!
Yeah, pg_dump missed comments attached to primary key constraints.
Fixed for 7.4.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.