[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [HACKERS] reloptions with a "namespace"
From:       Euler Taveira de Oliveira <euler () timbira ! com>
Date:       2009-01-31 4:47:41
Message-ID: 4983D7ED.6070807 () timbira ! com
[Download RAW message or body]

Euler Taveira de Oliveira escreveu:

[Forgot the first patch...]

> Alvaro Herrera escreveu:
>> New patch attached, with pg_dump support (thanks to Tom for the SQL
>> heads-up).
>>
> Great! We're close. Just two minor gripes:
> 
> + 	char	   *validnsps[] = { "toast" };
> 
> Surely, you forgot to add a NULL at the end. Patch is attached.
> 
> IIRC, my last patch includes a partial validation code for RESET cases. For
> example, the last SQL will not be atomic (invalid reloption silently ignored).
> So, why not apply the namespace validation code to RESET case too? Patch is
> attached too. It does not handle the reloptions validation because the relOpts
> initialization code is at parseRelOptions(); i leave it for a future refactor.
> 
> euler=# create table foo (a text) with (fillfactor=10);
> CREATE TABLE
> euler=# \d+ foo
>                  Tabela "public.foo"
>  Coluna | Tipo | Modificadores | Storage  | Descrição
> --------+------+---------------+----------+-----------
>  a      | text |               | extended |
> Têm OIDs: não
> Options: fillfactor=10
> 
> euler=# alter table foo reset (fillfactor,foo.fillfactor);
> ALTER TABLE
> euler=# \d+ foo
>                  Tabela "public.foo"
>  Coluna | Tipo | Modificadores | Storage  | Descrição
> --------+------+---------------+----------+-----------
>  a      | text |               | extended |
> Têm OIDs: não
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 


-- 
  Euler Taveira de Oliveira
  http://www.timbira.com/

["relopt-nmspc-3.diff" (text/plain)]

diff -cr pgsql.alvaro/src/backend/commands/tablecmds.c pgsql.euler/src/backend/commands/tablecmds.c
*** pgsql.alvaro/src/backend/commands/tablecmds.c	2009-01-31 02:01:22.000000000 -0200
--- pgsql.euler/src/backend/commands/tablecmds.c	2009-01-31 01:47:32.000000000 -0200
***************
*** 351,357 ****
  	Datum		reloptions;
  	ListCell   *listptr;
  	AttrNumber	attnum;
! 	char	   *validnsps[] = { "toast" };
  
  	/*
  	 * Truncate relname to appropriate length (probably a waste of time, as
--- 351,357 ----
  	Datum		reloptions;
  	ListCell   *listptr;
  	AttrNumber	attnum;
! 	static char	   *validnsps[] = { "toast", NULL };
  
  	/*
  	 * Truncate relname to appropriate length (probably a waste of time, as
***************
*** 6459,6465 ****
  	Datum		repl_val[Natts_pg_class];
  	bool		repl_null[Natts_pg_class];
  	bool		repl_repl[Natts_pg_class];
! 	char	   *validnsps[] = { "toast" };
  
  	if (defList == NIL)
  		return;					/* nothing to do */
--- 6459,6465 ----
  	Datum		repl_val[Natts_pg_class];
  	bool		repl_null[Natts_pg_class];
  	bool		repl_repl[Natts_pg_class];
! 	static char	   *validnsps[] = { "toast", NULL };
  
  	if (defList == NIL)
  		return;					/* nothing to do */
diff -cr pgsql.alvaro/src/backend/executor/execMain.c pgsql.euler/src/backend/executor/execMain.c
*** pgsql.alvaro/src/backend/executor/execMain.c	2009-01-31 02:01:22.000000000 -0200
--- pgsql.euler/src/backend/executor/execMain.c	2009-01-31 01:48:19.000000000 -0200
***************
*** 2832,2838 ****
  	Oid			intoRelationId;
  	TupleDesc	tupdesc;
  	DR_intorel *myState;
! 	char	   *validnsps[] = { "toast" };
  
  	Assert(into);
  
--- 2832,2838 ----
  	Oid			intoRelationId;
  	TupleDesc	tupdesc;
  	DR_intorel *myState;
! 	static char	   *validnsps[] = { "toast", NULL };
  
  	Assert(into);
  
Somente em pgsql.euler/src/backend/parser: gram.c
Somente em pgsql.euler/src/backend/parser: gram.h
Somente em pgsql.euler/src/backend/parser: scan.c
diff -cr pgsql.alvaro/src/backend/tcop/utility.c pgsql.euler/src/backend/tcop/utility.c
*** pgsql.alvaro/src/backend/tcop/utility.c	2009-01-31 02:01:22.000000000 -0200
--- pgsql.euler/src/backend/tcop/utility.c	2009-01-31 01:47:51.000000000 -0200
***************
*** 424,430 ****
  					if (IsA(stmt, CreateStmt))
  					{
  						Datum	toast_options;
! 						char   *validnsps[] = { "toast" };
  
  						/* Create the table itself */
  						relOid = DefineRelation((CreateStmt *) stmt,
--- 424,430 ----
  					if (IsA(stmt, CreateStmt))
  					{
  						Datum	toast_options;
! 						static char   *validnsps[] = { "toast", NULL };
  
  						/* Create the table itself */
  						relOid = DefineRelation((CreateStmt *) stmt,


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic