Re: [HACKERS] Adding attisdropped

2002-07-04 Thread Bruce Momjian


Seems we may not need isdropped, so I will hold on evaluating this.

---

Christopher Kings-Lynne wrote:
 Hi,
 
 I've attached the changes I've made to pg_attribute.h - I can't see what's
 wrong but whenever I do an initdb it fails:
 
 initdb -D /home/chriskl/local/data
 The files belonging to this database system will be owned by user chriskl.
 This user must also own the server process.
 
 The database cluster will be initialized with locale C.
 
 creating directory /home/chriskl/local/data... ok
 creating directory /home/chriskl/local/data/base... ok
 creating directory /home/chriskl/local/data/global... ok
 creating directory /home/chriskl/local/data/pg_xlog... ok
 creating directory /home/chriskl/local/data/pg_clog... ok
 creating template1 database in /home/chriskl/local/data/base/1...
 initdb failed.
 Removing /home/chriskl/local/data.
 
 Chris

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 4: Don't 'kill -9' the postmaster

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])





[HACKERS] Adding attisdropped

2002-07-03 Thread Christopher Kings-Lynne

Hi,

I've attached the changes I've made to pg_attribute.h - I can't see what's
wrong but whenever I do an initdb it fails:

initdb -D /home/chriskl/local/data
The files belonging to this database system will be owned by user chriskl.
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /home/chriskl/local/data... ok
creating directory /home/chriskl/local/data/base... ok
creating directory /home/chriskl/local/data/global... ok
creating directory /home/chriskl/local/data/pg_xlog... ok
creating directory /home/chriskl/local/data/pg_clog... ok
creating template1 database in /home/chriskl/local/data/base/1...
initdb failed.
Removing /home/chriskl/local/data.

Chris


Index: pg_attribute.h
===
RCS file: /projects/cvsroot/pgsql/src/include/catalog/pg_attribute.h,v
retrieving revision 1.93
diff -c -r1.93 pg_attribute.h
*** pg_attribute.h  2002/06/20 20:29:44 1.93
--- pg_attribute.h  2002/07/04 02:08:29
***
*** 142,147 
--- 142,150 
  
/* Has DEFAULT value or not */
boolatthasdef;
+ 
+   /* Is dropped or not */
+   boolattisdropped;
  } FormData_pg_attribute;
  
  /*
***
*** 150,156 
   * because of alignment padding at the end of the struct.)
   */
  #define ATTRIBUTE_TUPLE_SIZE \
!   (offsetof(FormData_pg_attribute,atthasdef) + sizeof(bool))
  
  /* 
   *Form_pg_attribute corresponds to a pointer to a tuple with
--- 153,159 
   * because of alignment padding at the end of the struct.)
   */
  #define ATTRIBUTE_TUPLE_SIZE \
!   (offsetof(FormData_pg_attribute,attisdropped) + sizeof(bool))
  
  /* 
   *Form_pg_attribute corresponds to a pointer to a tuple with
***
*** 164,170 
   * 
   */
  
! #define Natts_pg_attribute15
  #define Anum_pg_attribute_attrelid1
  #define Anum_pg_attribute_attname 2
  #define Anum_pg_attribute_atttypid3
--- 167,173 
   * 
   */
  
! #define Natts_pg_attribute16
  #define Anum_pg_attribute_attrelid1
  #define Anum_pg_attribute_attname 2
  #define Anum_pg_attribute_atttypid3
***
*** 180,185 
--- 183,189 
  #define Anum_pg_attribute_attalign13
  #define Anum_pg_attribute_attnotnull  14
  #define Anum_pg_attribute_atthasdef   15
+ #define Anum_pg_attribute_attisdropped16
  
  
  
***
*** 398,405 
  { 1249, {attstorage},   18, 0,  1, 11, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
  { 1249, {attisset},   16, 0,1, 12, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
  { 1249, {attalign},   18, 0,1, 13, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
! { 1249, {attnotnull},  16, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', false, 
false }, \
! { 1249, {atthasdef}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', 
false, false }
  
  DATA(insert ( 1249 attrelid   26 DEFAULT_ATTSTATTARGET  4   1 0 -1 
-1 t p f i f f));
  DATA(insert ( 1249 attname19 DEFAULT_ATTSTATTARGET NAMEDATALEN  
2 0 -1 -1 f p f i f f));
--- 402,410 
  { 1249, {attstorage},   18, 0,  1, 11, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
  { 1249, {attisset},   16, 0,1, 12, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
  { 1249, {attalign},   18, 0,1, 13, 0, -1, -1, true, 'p', false, 'c', 
false, false }, \
! { 1249, {attnotnull},   16, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', false, 
false }, \
! { 1249, {atthasdef},16, 0, 1, 15, 0, -1, -1, true, 'p', false, 
'c', false, false }, \
! { 1249, {attisdropped}, 16, 0, 1, 16, 0, -1, -1, true, 'p', false, 'c', false, 
false }
  
  DATA(insert ( 1249 attrelid   26 DEFAULT_ATTSTATTARGET  4   1 0 -1 
-1 t p f i f f));
  DATA(insert ( 1249 attname19 DEFAULT_ATTSTATTARGET NAMEDATALEN  
2 0 -1 -1 f p f i f f));
***
*** 416,421 
--- 421,427 
  DATA(insert ( 1249 attalign   18 0  1  13 0 -1 -1 t p f c f f));
  DATA(insert ( 1249 attnotnull 16 0  1  14 0 -1 -1 t p f c f f));
  DATA(insert ( 1249 atthasdef  16 0  1  15 0 -1 -1 t p f c f f));
+ DATA(insert ( 1249 attisdropped   16 0  1  16 0 -1 -1 t p f c f f));
  DATA(insert ( 1249 ctid   27 0  6  -1 0 -1 -1 f p f i f 
f));
  /* no OIDs in pg_attribute */
  DATA(insert ( 1249 xmin   28 0  4  -3 0 -1 -1 t p f i f 
f));



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [HACKERS] Adding attisdropped

2002-07-03 Thread Tom Lane

Christopher Kings-Lynne [EMAIL PROTECTED] writes:
 I've attached the changes I've made to pg_attribute.h - I can't see what's
 wrong but whenever I do an initdb it fails:

Did you change the relnatts entry in pg_class.h for pg_attribute?

More generally, run initdb with -d or -v or whatever its debug-output
switch is, and look at the last few lines to see the actual error.
(Caution: this may produce megabytes of output.)

regards, tom lane



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]