Re: [PATCHES] note on dropped columns in pg_attribute
On Friday 05 September 2003 16:24, Peter Eisentraut wrote: > Robert Treat writes: > > I didn't see it documented anywhere that a 0 in attypid of pg_attribute, > > and given the note on the need to match pg_type lest failure seems to > > warrant the mention. > > A column is dropped if and only if attisdropped is true. Right. I didn't mean to imply otherwise. That first line should have read "I didn't see it documented anywhere that a 0 in attypid of pg_attribute is OK with dropped columns". My only point was that in the notes it says that attypid is the OID in pg_type, and that information in that table must match information in this table else PostgreSQL will fail. However that's not neccessarily true for dropped columns where there is no match cause attypid will be 0. Are there other cases where it can be set to 0? Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [PATCHES] note on dropped columns in pg_attribute
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Robert Treat writes: >> I didn't see it documented anywhere that a 0 in attypid of pg_attribute, >> and given the note on the need to match pg_type lest failure seems to >> warrant the mention. > A column is dropped if and only if attisdropped is true. Yes. If we're going to add something to pg_attribute.h, it ought to say that atttypid is *undefined* in a dropped column. The last thing we need is people testing it instead of attisdropped. Also, any such documentation addition should go into catalogs.sgml not only the .h file. BTW, the rationale for the behavior Robert noticed is explained in heap.c: /* * Set the type OID to invalid. A dropped attribute's type link * cannot be relied on (once the attribute is dropped, the type might * be too). Fortunately we do not need the type row --- the only * really essential information is the type's typlen and typalign, * which are preserved in the attribute's attlen and attalign. We set * atttypid to zero here as a means of catching code that incorrectly * expects it to be valid. */ attStruct->atttypid = InvalidOid; regards, tom lane ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [PATCHES] note on dropped columns in pg_attribute
Robert Treat writes: > I didn't see it documented anywhere that a 0 in attypid of pg_attribute, > and given the note on the need to match pg_type lest failure seems to > warrant the mention. A column is dropped if and only if attisdropped is true. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[PATCHES] note on dropped columns in pg_attribute
I didn't see it documented anywhere that a 0 in attypid of pg_attribute, and given the note on the need to match pg_type lest failure seems to warrant the mention. Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL Index: src/include/catalog/pg_attribute.h === RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_attribute.h,v retrieving revision 1.104 diff -c -r1.104 pg_attribute.h *** src/include/catalog/pg_attribute.h 4 Aug 2003 02:40:11 - 1.104 --- src/include/catalog/pg_attribute.h 4 Sep 2003 22:30:44 - *** *** 50,56 * defines the data type of this attribute (e.g. int4). Information * in that instance is redundant with the attlen, attbyval, and * attalign attributes of this instance, so they had better match or ! * Postgres will fail. */ Oid atttypid; --- 50,57 * defines the data type of this attribute (e.g. int4). Information * in that instance is redundant with the attlen, attbyval, and * attalign attributes of this instance, so they had better match or ! * Postgres will fail. An entry of 0 signifies a dropped column and ! * will have no match. */ Oid atttypid; ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster