I attached patch which add capability to have single record for all
realation kind in the reloption list. It is usefull in situation when
all parameters are same for all relation kinds.


        Zdenek
diff -Nrc pgsql_spacereserve.4cf1ae611238/src/backend/access/common/reloptions.c pgsql_spacereserve/src/backend/access/common/reloptions.c
*** pgsql_spacereserve.4cf1ae611238/src/backend/access/common/reloptions.c	2009-01-23 14:09:43.544267884 +0100
--- pgsql_spacereserve/src/backend/access/common/reloptions.c	2009-01-23 14:09:43.548835990 +0100
***************
*** 592,598 ****
  	/* Build a list of expected options, based on kind */
  
  	for (i = 0; relOpts[i]; i++)
! 		if (relOpts[i]->kind == kind)
  			numoptions++;
  
  	if (numoptions == 0)
--- 609,615 ----
  	/* Build a list of expected options, based on kind */
  
  	for (i = 0; relOpts[i]; i++)
! 		if (relOpts[i]->kind == kind || relOpts[i]->kind == RELOPT_KIND_ALL)
  			numoptions++;
  
  	if (numoptions == 0)
***************
*** 605,611 ****
  
  	for (i = 0, j = 0; relOpts[i]; i++)
  	{
! 		if (relOpts[i]->kind == kind)
  		{
  			reloptions[j].gen = relOpts[i];
  			reloptions[j].isset = false;
--- 622,628 ----
  
  	for (i = 0, j = 0; relOpts[i]; i++)
  	{
! 		if (relOpts[i]->kind == kind || relOpts[i]->kind == RELOPT_KIND_ALL)
  		{
  			reloptions[j].gen = relOpts[i];
  			reloptions[j].isset = false;
diff -Nrc pgsql_spacereserve.4cf1ae611238/src/include/access/reloptions.h pgsql_spacereserve/src/include/access/reloptions.h
*** pgsql_spacereserve.4cf1ae611238/src/include/access/reloptions.h	2009-01-23 14:09:43.546952126 +0100
--- pgsql_spacereserve/src/include/access/reloptions.h	2009-01-23 14:09:43.549952702 +0100
***************
*** 32,37 ****
--- 32,38 ----
  /* kinds supported by reloptions */
  typedef enum relopt_kind
  {
+ 	RELOPT_KIND_ALL,
  	RELOPT_KIND_HEAP,
  	/* XXX do we need a separate kind for TOAST tables? */
  	RELOPT_KIND_BTREE,
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to