Re: [PATCHES] TupleDesc refcounting

2006-01-15 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes:
 On Thu, 2006-01-12 at 10:40 -0500, Tom Lane wrote:
 If you're finding yourself writing a large and invasive patch, I think
 you're doing it wrong.

 I think I might be :-)

Yipes ... this seems far more invasive than I think is justified.
In particular the notion of storing *every* tupdesc in TopMemoryContext
seems completely wrong.  That's not working with the context system,
that's working against it.

What I had in mind was an optional refcounting facility, whereas you
seem to be going in the direction of making it mandatory.  The reason
I think it should be optional is that most uses of tupdescs just don't
need it.  We have a grand total of one place where a refcount (or forced
local copy) seems demonstrably necessary.  Surely changing a whole lot
of code to accommodate that one place is not the right tradeoff.

My inclination at this point is to forget the whole thing and just patch
the callers of lookup_rowtype_tupdesc that need to copy the tupdesc.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] inferred param types for PREPARE

2006-01-15 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes:
 The only trickiness was allowing UNKNOWN to be specified in the list
 of type names in the PREPARE statement. Since UNKNOWN was previously an
 unreserved_keyword, this caused reduce/reduce conflicts:

You're doing it wrong.  There is no need for any special case whatever
in gram.y --- ordinary lookup of the type name will do fine.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] inferred param types for PREPARE

2006-01-15 Thread Neil Conway
On Sun, 2006-01-15 at 12:17 -0500, Tom Lane wrote:
 You're doing it wrong.  There is no need for any special case whatever
 in gram.y --- ordinary lookup of the type name will do fine.

Woops, good point. Attached is a revised patch that doesn't modify the
grammar, and includes updates to the documentation and regression tests.
Applied to HEAD.

-Neil


*** doc/src/sgml/ref/deallocate.sgml	47093d8fa4ee9a32c2913ea147d3d9502a51a12e
--- doc/src/sgml/ref/deallocate.sgml	a9b19cf7cc5471f6cbd52c015eeb3fa24b57821d
***
*** 25,31 
  
   refsynopsisdiv
  synopsis
! DEALLOCATE [ PREPARE ] replaceable class=parameterplan_name/replaceable
  /synopsis
   /refsynopsisdiv
  
--- 25,31 
  
   refsynopsisdiv
  synopsis
! DEALLOCATE [ PREPARE ] replaceable class=parametername/replaceable
  /synopsis
   /refsynopsisdiv
  
***
*** 58,64 
 /varlistentry
  
 varlistentry
! termreplaceable class=parameterplan_name/replaceable/term
  listitem
   para
The name of the prepared statement to deallocate.
--- 58,64 
 /varlistentry
  
 varlistentry
! termreplaceable class=parametername/replaceable/term
  listitem
   para
The name of the prepared statement to deallocate.

*** doc/src/sgml/ref/execute.sgml	fa053d68c10cadae226e45da2c38199325043346
--- doc/src/sgml/ref/execute.sgml	12d45d714aeaf6494d6c3b12e995c980626f9099
***
*** 25,31 
  
   refsynopsisdiv
  synopsis
! EXECUTE replaceable class=PARAMETERplan_name/replaceable [ (replaceable class=PARAMETERparameter/replaceable [, ...] ) ]
  /synopsis
   /refsynopsisdiv
  
--- 25,31 
  
   refsynopsisdiv
  synopsis
! EXECUTE replaceable class=PARAMETERname/replaceable [ (replaceable class=PARAMETERparameter/replaceable [, ...] ) ]
  /synopsis
   /refsynopsisdiv
  
***
*** 60,66 
  
variablelist
 varlistentry
! termreplaceable class=PARAMETERplan_name/replaceable/term
  listitem
   para
The name of the prepared statement to execute.
--- 60,66 
  
variablelist
 varlistentry
! termreplaceable class=PARAMETERname/replaceable/term
  listitem
   para
The name of the prepared statement to execute.
***
*** 73,82 
  listitem
   para
The actual value of a parameter to the prepared statement.  This
!   must be an expression yielding a value of a type compatible with
!   the data type specified for this parameter position in the
!   commandPREPARE/command command that created the prepared
!   statement.
   /para
  /listitem
 /varlistentry
--- 73,81 
  listitem
   para
The actual value of a parameter to the prepared statement.  This
!   must be an expression yielding a value that is compatible with
!   the data type of this parameter, as was determined when the
!   prepared statement was created.
   /para
  /listitem
 /varlistentry

*** doc/src/sgml/ref/prepare.sgml	3449586c977e47e193388d8c2fa4ff250b06e59f
--- doc/src/sgml/ref/prepare.sgml	d54a7b2167a1c5a83fe305ad97b1d1bc270c92c9
***
*** 25,31 
  
   refsynopsisdiv
  synopsis
! PREPARE replaceable class=PARAMETERplan_name/replaceable [ (replaceable class=PARAMETERdatatype/replaceable [, ...] ) ] AS replaceable class=PARAMETERstatement/replaceable
  /synopsis
   /refsynopsisdiv
  
--- 25,31 
  
   refsynopsisdiv
  synopsis
! PREPARE replaceable class=PARAMETERname/replaceable [ (replaceable class=PARAMETERdatatype/replaceable [, ...] ) ] AS replaceable class=PARAMETERstatement/replaceable
  /synopsis
   /refsynopsisdiv
  
***
*** 45,57 
  
para
 Prepared statements can take parameters: values that are
!substituted into the statement when it is executed. To include
!parameters in a prepared statement, supply a list of data types in
!the commandPREPARE/command statement, and, in the statement to
!be prepared itself, refer to the parameters by position using
!literal$1/literal, literal$2/literal, etc. When executing
!the statement, specify the actual values for these parameters in
!the commandEXECUTE/command statement.  Refer to xref
 linkend=sql-execute endterm=sql-execute-title for more
 information about that.
/para
--- 45,59 
  
para
 Prepared statements can take parameters: values that are
!substituted into the statement when it is executed. When creating
!the prepared statement, refer to parameters by position, using
!literal$1/, literal$2/, etc. A corresponding list of
!parameter data types can optionally be specified. When a
!parameter's data type is not specified or is declared as
!literalunknown/literal, the type is inferred from the context
!in which the 

Re: [PATCHES] inferred param types for PREPARE

2006-01-15 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes:
 Woops, good point. Attached is a revised patch that doesn't modify the
 grammar, and includes updates to the documentation and regression tests.

BTW, I wonder whether it wouldn't be a better idea to declare the
pg_prepared_statement view's parameter_types column as regtype[]
instead of oid[].  This would make the default output much more
readable, ie you'd get things like '{integer,boolean}' instead of
'{23,16}'.  Of course you can cast in either direction to get the
other form, but defaulting to text instead of numeric output seems
like it might be a better choice.

The option of casting to get the other form should probably be mentioned
in the view's documentation page, whichever is the default.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] patch to create system view that lists cursors

2006-01-15 Thread Neil Conway
On Thu, 2006-01-12 at 19:51 -0500, Tom Lane wrote: 
 Neil Conway [EMAIL PROTECTED] writes:
  It would also mean that this would produce unexpected results:
  PREPARE foo AS SELECT * FROM pg_cursors; EXECUTE foo.
 
 Unexpected in what sense?

Unexpected in the sense that the user would have no reason to expect
an unnamed portal n row in the pg_cursors view, merely because we
happen to create a portal internally to implement the EXECUTE command.

I think the view should include the portals created by DECLARE CURSOR
and Bind protocol messages, but should not include the unnamed portal
or any other portals that are created internally as part of the
implementation of other commands (e.g. EXECUTE). I'm not sure how to
handle SPI: developers using SPI would expect to find their portals in
the view, but those using SPI indirectly (e.g. via PL/foo) would
probably find the clutter surprising. I'd say we need to include SPI
portals in the view as well.

-Neil



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


Re: [PATCHES] Fix overflow of bgwriter's request queue

2006-01-15 Thread ITAGAKI Takahiro
Tom Lane [EMAIL PROTECTED] wrote:

  ITAGAKI Takahiro [EMAIL PROTECTED] wrote
  AbsorbFsyncRequests will be called during the fsync loop in my patch,
  so new files might be added to pendingOpsTable and they will be removed
  from the table *before* writing the pages belonging to them.
 
 I think this fear is incorrect.  At the time ForwardFsyncRequest is
 called, the backend must *already* have done whatever write it is
 concerned about fsync'ing.

Oops, I was wrong. Also, I see that there is no necessity for fearing
endless loops because hash-seqscan and HASH_ENTER don't conflict.

Attached is a revised patch. It became very simple, but I worry that
one magic number (BUFFERS_PER_ABSORB) is still left.

---
ITAGAKI Takahiro
NTT Cyber Space Laboratories



bgwriter-requests-queue-overflow-3.patch
Description: Binary data

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[PATCHES] Uninstall scripts for contrib

2006-01-15 Thread David Fetter
Folks,

Please find attached a patch against CVS TIP which adds an uninstall
script in SQL for each of the things where it would be appropriate.
Contrib modules that already have an uninstall script are left as-is,
as are ones which create stand-alone executeables, as I believe that
we need to discuss what an uninstall script (if any) would look like
for those.

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778

Remember to vote!
Index: contrib/btree_gist/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/btree_gist/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** contrib/btree_gist/Makefile 27 Sep 2005 17:12:59 -  1.8
--- contrib/btree_gist/Makefile 14 Jan 2006 23:16:18 -
***
*** 7,12 
--- 7,13 
btree_bytea.o btree_bit.o btree_numeric.o
  
  DATA_built  = btree_gist.sql
+ DATA= uninstall.sql
  DOCS= README.btree_gist
  
  REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp 
timestamptz time timetz \
Index: contrib/chkpass/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/chkpass/Makefile,v
retrieving revision 1.7
diff -c -r1.7 Makefile
*** contrib/chkpass/Makefile27 Sep 2005 17:13:00 -  1.7
--- contrib/chkpass/Makefile14 Jan 2006 23:16:03 -
***
*** 1,9 
! # $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.6 2004/08/20 20:13:02 
momjian Exp $
  
  MODULE_big = chkpass
  OBJS = chkpass.o
  SHLIB_LINK = $(filter -lcrypt, $(LIBS))
  DATA_built = chkpass.sql
  DOCS = README.chkpass
  
  ifdef USE_PGXS
--- 1,10 
! # $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.7 2005/09/27 17:13:00 tgl 
Exp $
  
  MODULE_big = chkpass
  OBJS = chkpass.o
  SHLIB_LINK = $(filter -lcrypt, $(LIBS))
  DATA_built = chkpass.sql
+ DATA = uninstall.sql
  DOCS = README.chkpass
  
  ifdef USE_PGXS
Index: contrib/cube/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/cube/Makefile,v
retrieving revision 1.15
diff -c -r1.15 Makefile
*** contrib/cube/Makefile   18 Oct 2005 01:30:48 -  1.15
--- contrib/cube/Makefile   14 Jan 2006 23:15:58 -
***
*** 1,9 
! # $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.14 2005/09/27 17:13:00 tgl Exp 
$
  
  MODULE_big = cube
  OBJS= cube.o cubeparse.o
  
  DATA_built = cube.sql
  DOCS = README.cube
  REGRESS = cube
  
--- 1,10 
! # $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.15 2005/10/18 01:30:48 tgl Exp 
$
  
  MODULE_big = cube
  OBJS= cube.o cubeparse.o
  
  DATA_built = cube.sql
+ DATA = uninstall.sql
  DOCS = README.cube
  REGRESS = cube
  
Index: contrib/dblink/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/dblink/Makefile,v
retrieving revision 1.10
diff -c -r1.10 Makefile
*** contrib/dblink/Makefile 27 Sep 2005 17:13:01 -  1.10
--- contrib/dblink/Makefile 14 Jan 2006 23:15:52 -
***
*** 1,4 
! # $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.9 2004/08/20 20:13:03 
momjian Exp $
  
  MODULE_big = dblink
  PG_CPPFLAGS = -I$(libpq_srcdir)
--- 1,4 
! # $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.10 2005/09/27 17:13:01 tgl 
Exp $
  
  MODULE_big = dblink
  PG_CPPFLAGS = -I$(libpq_srcdir)
***
*** 6,11 
--- 6,12 
  SHLIB_LINK = $(libpq)
  
  DATA_built = dblink.sql 
+ DATA = uninstall.sql 
  DOCS = README.dblink
  REGRESS = dblink
  
Index: contrib/dbmirror/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/dbmirror/Makefile,v
retrieving revision 1.5
diff -c -r1.5 Makefile
*** contrib/dbmirror/Makefile   27 Sep 2005 17:13:01 -  1.5
--- contrib/dbmirror/Makefile   14 Jan 2006 22:54:52 -
***
*** 1,4 
! # $PostgreSQL: pgsql/contrib/dbmirror/Makefile,v 1.4 2004/11/04 06:09:19 
neilc Exp $
  
  MODULES = pending
  SCRIPTS = clean_pending.pl DBMirror.pl
--- 1,4 
! # $PostgreSQL: pgsql/contrib/dbmirror/Makefile,v 1.5 2005/09/27 17:13:01 tgl 
Exp $
  
  MODULES = pending
  SCRIPTS = clean_pending.pl DBMirror.pl
Index: contrib/earthdistance/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/earthdistance/Makefile,v
retrieving revision 1.16
diff -c -r1.16 Makefile
*** contrib/earthdistance/Makefile  27 Sep 2005 17:13:02 -  1.16
--- contrib/earthdistance/Makefile  14 Jan 2006 23:15:40 -
***
*** 1,7 
! # $PostgreSQL: pgsql/contrib/earthdistance/Makefile,v 1.15 2005/07/24 
23:30:09 tgl Exp $
  
  MODULES = earthdistance
  DATA_built = earthdistance.sql
  DOCS = README.earthdistance
  REGRESS = earthdistance
  
--- 1,8 
! # $PostgreSQL: pgsql/contrib/earthdistance/Makefile,v 1.16 2005/09/27 
17:13:02 

Re: [PATCHES] inferred param types for PREPARE

2006-01-15 Thread Neil Conway
On Sun, 2006-01-15 at 17:33 -0500, Tom Lane wrote:
 BTW, I wonder whether it wouldn't be a better idea to declare the
 pg_prepared_statement view's parameter_types column as regtype[]
 instead of oid[].

Yeah, good point -- I had thought that using type names would be
ambiguous in the presence of schemas, but of course regtype solves that
problem. Attached is a patch that implements this -- barring any
objections I'll apply this tomorrow.

-Neil


*** doc/src/sgml/catalogs.sgml	324ea64622e513dbf036e56cc38f4ccc2955ef6e
--- doc/src/sgml/catalogs.sgml	156840ca28113a4e95833cd9b5c5d410e047c366
***
*** 284,291 
entry
 The initial value of the transition state.  This is a text
 field containing the initial value in its external string
!representation.  If this field is null, the transition state
!value starts out null.
/entry
   /row
  /tbody
--- 284,291 
entry
 The initial value of the transition state.  This is a text
 field containing the initial value in its external string
!representation.  If this field is NULL, the transition state
!value starts out NULL.
/entry
   /row
  /tbody
***
*** 293,302 
/table
  
para
!New aggregate functions are registered with the commandCREATE
!AGGREGATE/command command.  See xref linkend=xaggr for more
!information about writing aggregate functions and the meaning of
!the transition functions, etc.
/para
  
   /sect1
--- 293,303 
/table
  
para
!New aggregate functions are registered with the xref
!linkend=sql-createaggregate endterm=sql-createaggregate-title
!command.  See xref linkend=xaggr for more information about
!writing aggregate functions and the meaning of the transition
!functions, etc.
/para
  
   /sect1
***
*** 1018,1024 
entrytypebool/type/entry
entry/entry
entry
!Role may log in, that is, this role can be given as the initial
 session authorization identifier.
/entry
   /row
--- 1019,1025 
entrytypebool/type/entry
entry/entry
entry
!Role may log in. That is, this role can be given as the initial
 session authorization identifier.
/entry
   /row
***
*** 1561,1567 
entrystructfieldrelukeys/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryunused  (emphasisnot/emphasis the number of unique keys)/entry
   /row
  
   row
--- 1562,1568 
entrystructfieldrelukeys/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryUnused  (emphasisnot/emphasis the number of unique keys)/entry
   /row
  
   row
***
*** 1568,1574 
entrystructfieldrelfkeys/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryunused  (emphasisnot/emphasis the number of foreign keys on the table)/entry
   /row
  
   row
--- 1569,1575 
entrystructfieldrelfkeys/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryUnused  (emphasisnot/emphasis the number of foreign keys on the table)/entry
   /row
  
   row
***
*** 1575,1581 
entrystructfieldrelrefs/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryunused/entry
   /row
  
   row
--- 1576,1582 
entrystructfieldrelrefs/structfield/entry
entrytypeint2/type/entry
entry/entry
!   entryUnused/entry
   /row
  
   row
***
*** 1583,1589 
entrytypebool/type/entry
entry/entry
entry
!True if we generate an OID for each row of the relation.
/entry
   /row
  
--- 1584,1590 
entrytypebool/type/entry
entry/entry
entry
!True if we generate an OID for each row of the relation
/entry
   /row
  
***
*** 1592,1598 
entrytypebool/type/entry
entry/entry
entry
!True if the table has (or once had) a primary key.
/entry
   /row
  
--- 1593,1599 
entrytypebool/type/entry
entry/entry
entry
!True if the table has (or once had) a primary key
/entry
   /row
  
***
*** 1601,1607 
entrytypebool/type/entry
entry/entry
entryTrue if table has rules; see
!structnamepg_rewrite/structname catalog.
/entry
   /row
  
--- 1602,1608 
entrytypebool/type/entry
entry/entry
entryTrue if table has rules; see
!structnamepg_rewrite/structname catalog
/entry
   /row
  
***
*** 1609,1615 
entrystructfieldrelhassubclass/structfield/entry

Re: [PATCHES] Uninstall scripts for contrib

2006-01-15 Thread Neil Conway
On Sun, 2006-01-15 at 20:08 -0800, David Fetter wrote:
 *** contrib/chkpass/Makefile27 Sep 2005 17:13:00 -  1.7
 --- contrib/chkpass/Makefile14 Jan 2006 23:16:03 -
 ***
 *** 1,9 
 ! # $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.6 2004/08/20
 20:13:02 momjian Exp $
   
   MODULE_big = chkpass
   OBJS = chkpass.o
   SHLIB_LINK = $(filter -lcrypt, $(LIBS))
   DATA_built = chkpass.sql
   DOCS = README.chkpass
   
   ifdef USE_PGXS
 --- 1,10 
 ! # $PostgreSQL: pgsql/contrib/chkpass/Makefile,v 1.7 2005/09/27
 17:13:00 tgl Exp $
   
   MODULE_big = chkpass
   OBJS = chkpass.o
   SHLIB_LINK = $(filter -lcrypt, $(LIBS))
   DATA_built = chkpass.sql
 + DATA = uninstall.sql
   DOCS = README.chkpass
   
   ifdef USE_PGXS 

The change to $PostgreSQL$ is bogus (perhaps due to the way you setup
cvsup?), as are all the other $PostgreSQL$ changes in the patch. Also,
the patch doesn't actually add any files called uninstall.sql.

-Neil



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


Re: [PATCHES] Uninstall scripts for contrib

2006-01-15 Thread David Fetter
On Mon, Jan 16, 2006 at 12:13:11AM -0500, Neil Conway wrote:
 On Sun, 2006-01-15 at 20:08 -0800, David Fetter wrote:

ifdef USE_PGXS 
 
 The change to $PostgreSQL$ is bogus (perhaps due to the way you
 setup cvsup?), as are all the other $PostgreSQL$ changes in the
 patch. Also, the patch doesn't actually add any files called
 uninstall.sql.

Oops.  My FM R'ing skills need some work.  This patch includes the
files.

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 415 235 3778

Remember to vote!
Index: contrib/btree_gist/Makefile
===
RCS file: /oracle/CVSup/pgsql/contrib/btree_gist/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** contrib/btree_gist/Makefile 27 Sep 2005 17:12:59 -  1.8
--- contrib/btree_gist/Makefile 14 Jan 2006 23:16:18 -
***
*** 7,12 
--- 7,13 
btree_bytea.o btree_bit.o btree_numeric.o
  
  DATA_built  = btree_gist.sql
+ DATA= uninstall.sql
  DOCS= README.btree_gist
  
  REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp 
timestamptz time timetz \
Index: contrib/btree_gist/uninstall.sql
===
RCS file: contrib/btree_gist/uninstall.sql
diff -N contrib/btree_gist/uninstall.sql
*** /dev/null   1 Jan 1970 00:00:00 -
--- contrib/btree_gist/uninstall.sql14 Jan 2006 21:57:09 -
***
*** 0 
--- 1,301 
+ SET search_path = public;
+ 
+ DROP OPERATOR CLASS gist_cidr_ops;
+ 
+ DROP OPERATOR CLASS gist_inet_ops;
+ 
+ DROP FUNCTION gbt_inet_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_inet_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_inet_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_inet_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_cidr_compress(internal);
+ 
+ DROP FUNCTION gbt_inet_compress(internal);
+ 
+ DROP FUNCTION gbt_cidr_consistent(internal,cidr,int2);
+ 
+ DROP FUNCTION gbt_inet_consistent(internal,inet,int2);
+ 
+ DROP OPERATOR CLASS gist_vbit_ops;
+ 
+ DROP OPERATOR CLASS gist_bit_ops;
+ 
+ DROP FUNCTION gbt_bit_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_bit_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_bit_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_bit_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_bit_compress(internal);
+ 
+ DROP FUNCTION gbt_bit_consistent(internal,bit,int2);
+ 
+ DROP OPERATOR CLASS gist_numeric_ops;
+ 
+ DROP FUNCTION gbt_numeric_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_numeric_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_numeric_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_numeric_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_numeric_compress(internal);
+ 
+ DROP FUNCTION gbt_numeric_consistent(internal,numeric,int2);
+ 
+ DROP OPERATOR CLASS gist_bytea_ops;
+ 
+ DROP FUNCTION gbt_bytea_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_bytea_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_bytea_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_bytea_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_bytea_compress(internal);
+ 
+ DROP FUNCTION gbt_bytea_consistent(internal,bytea,int2);
+ 
+ DROP OPERATOR CLASS gist_bpchar_ops;
+ 
+ DROP OPERATOR CLASS gist_text_ops;
+ 
+ DROP FUNCTION gbt_text_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_text_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_text_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_text_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_bpchar_compress(internal);
+ 
+ DROP FUNCTION gbt_text_compress(internal);
+ 
+ DROP FUNCTION gbt_bpchar_consistent(internal,bpchar,int2);
+ 
+ DROP FUNCTION gbt_text_consistent(internal,text,int2);
+ 
+ DROP OPERATOR CLASS gist_macaddr_ops;
+ 
+ DROP FUNCTION gbt_macad_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_macad_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_macad_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_macad_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_macad_compress(internal);
+ 
+ DROP FUNCTION gbt_macad_consistent(internal,macaddr,int2);
+ 
+ DROP OPERATOR CLASS gist_cash_ops;
+ 
+ DROP FUNCTION gbt_cash_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_cash_union(bytea, internal);
+ 
+ DROP FUNCTION gbt_cash_picksplit(internal, internal);
+ 
+ DROP FUNCTION gbt_cash_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_cash_compress(internal);
+ 
+ DROP FUNCTION gbt_cash_consistent(internal,money,int2);
+ 
+ DROP OPERATOR CLASS gist_interval_ops;
+ 
+ DROP FUNCTION gbt_intv_same(internal, internal, internal);
+ 
+ DROP FUNCTION gbt_intv_union(bytea, internal);
+   
+ DROP FUNCTION gbt_intv_picksplit(internal, internal);
+
+ DROP FUNCTION gbt_intv_penalty(internal,internal,internal);
+ 
+ DROP FUNCTION gbt_intv_decompress(internal);
+ 
+ DROP 

[PATCHES] New pg_dump options: exclude tables/schemas, multiple all, wildcards

2006-01-15 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
 
 
Attached is a patch to hopefully make pg_dump a lot more useful.
I started out by making it simply able to avoid dumping a single
table, but, inspired by David Fetter's patch last November, also
added in support for multiple items and limited wildcard matching.
 
-n and -N control the schemas, and -t and -T control the tables.
 
Wildcards can be a star at the start, the end, or on both sides
of a term. The patch acts inclusively with conflicts: the -t
option trumps the -N option.
 
Some examples:
 
To dump all tables beginning with the string slony, plus
all tables with the word log inside of them:
 
pg_dump -t slony* -t *log*
 
To dump all schemas except dev and qa, and all tables
except those ending in large:
 
pg_dump -N dev -N qa -T *large
 
--
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200601152100
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-
 
iD8DBQFDyv9NvJuQZxSWSsgRAup9AKD110JJtJBYYPV5JxFROovfeddrSACg3IZ3
BqczBImC8UCVmik3YFHvDeQ=
=Y9zs
-END PGP SIGNATURE-

Index: doc/src/sgml/ref/pg_dump.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v
retrieving revision 1.81
diff -c -r1.81 pg_dump.sgml
*** doc/src/sgml/ref/pg_dump.sgml	1 Nov 2005 21:09:50 -	1.81
--- doc/src/sgml/ref/pg_dump.sgml	16 Jan 2006 01:53:38 -
***
*** 294,300 
 para
  Dump the contents of replaceable class=parameterschema/
  only. If this option is not specified, all non-system schemas
! in the target database will be dumped.
 /para
  
 note
--- 294,302 
 para
  Dump the contents of replaceable class=parameterschema/
  only. If this option is not specified, all non-system schemas
! in the target database will be dumped. Can be set multiple times 
! to dump more than one schema. Supports limited wildcards: you may 
! put a star at the beginning and/or the end of the name.
 /para
  
 note
***
*** 310,315 
--- 312,330 
   /varlistentry
  
   varlistentry
+   termoption-N replaceable class=parameterschema/replaceable/option/term
+   termoption--exclude-schema=replaceable class=parameterschema/replaceable/option/term
+   listitem
+para
+ Do not dump the named replaceable class=parameterschema/.
+ Can be set multiple times to exclude more than one schema. Supports limited 
+ wildcards: you may put a star at the beginning and/or the end of the name.
+ The -t argument is not affected by -N.
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry
termoption-o//term
termoption--oids//term
listitem
***
*** 389,398 
listitem
 para
  Dump data for replaceable class=parametertable/replaceable
! only. It is possible for there to be
! multiple tables with the same name in different schemas; if that
! is the case, all matching tables will be dumped.  Specify both
! option--schema/ and option--table/ to select just one table.
 /para
  
 note
--- 404,414 
listitem
 para
  Dump data for replaceable class=parametertable/replaceable
! only. It is possible for there to be multiple tables with the same 
! name in different schemas; if that is the case, all matching tables 
! will be dumped, unless the -n option is used. Can be set multiple times 
! to dump more than one table. Supports limited wildcards: you may put a 
! star at the beginning and/or the end of the name.
 /para
  
 note
***
*** 408,413 
--- 424,444 
   /varlistentry
  
   varlistentry
+   termoption-T replaceable class=parametertable/replaceable/option/term
+   termoption--exclude-table=replaceable class=parametertable/replaceable/option/term
+   listitem
+para
+ Do not dump the named replaceable class=parametertable/replaceable.
+ It is possible for there to be multiple tables with the same name in 
+ different schemas; if that is the case, all matching tables will be excluded.
+ Can be set multiple times to exclude more than one table. Supports limited 
+ wildcards: you may put a star at the beginning and/or the end of the name.
+ The -n argument is not affected by -T.
+/para
+   /listitem
+  /varlistentry
+ 
+  varlistentry
termoption-v//term
termoption--verbose//term
listitem
***
*** 672,677 
--- 703,732 
  /screen
/para
  
+   para
+To dump all schemas except those beginning with an underscore:
+ 
+ screen
+ prompt$/prompt