Re: [PATCHES] Fix for VACUUM in psql autocommit off

2004-09-19 Thread Tom Lane
Michael Paesold [EMAIL PROTECTED] writes:
 In current cvs (as in version 7.4.5), VACUUM does not work at all in
 autocommit=off mode. That is, because psql does not know that VACUUM cannot
 be performed inside an transaction.
 I consider this a bug and suggest the attached fix.

If we're going to do that, we should also include the other statements
that disallow execution in a transaction, and we should rename
is_transact_command to something more appropriate (not to mention fix
its comments).  A quick grep shows

/home/postgres/pgsql/src/backend/commands/dbcommands.c: 95: 
PreventTransactionChain((void *) stmt, CREATE DATABASE);
/home/postgres/pgsql/src/backend/commands/dbcommands.c: 497:
PreventTransactionChain((void *) dbname, DROP DATABASE);
/home/postgres/pgsql/src/backend/commands/cluster.c: 175:   
PreventTransactionChain((void *) stmt, CLUSTER);
/home/postgres/pgsql/src/backend/commands/indexcmds.c: 995: 
PreventTransactionChain((void *) dbname, REINDEX DATABASE);
/home/postgres/pgsql/src/backend/commands/vacuum.c: 262:
PreventTransactionChain((void *) vacstmt, stmttype);
/home/postgres/pgsql/src/backend/commands/tablespace.c: 221:
PreventTransactionChain((void *) stmt, CREATE TABLESPACE);
/home/postgres/pgsql/src/backend/commands/tablespace.c: 407:
PreventTransactionChain((void *) stmt, DROP TABLESPACE);

Handling the multi-keyword cases is going to take a nontrivial increment
of functionality.  Perhaps while we're at it, we could teach this code
about nested /* comments ...

regards, tom lane

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

   http://archives.postgresql.org


Re: [PATCHES] Fix for VACUUM in psql autocommit off

2004-09-19 Thread Michael Paesold
Tom Lane wrote:


 If we're going to do that, we should also include the other statements
 that disallow execution in a transaction, and we should rename
 is_transact_command to something more appropriate (not to mention fix
 its comments).  A quick grep shows

 PreventTransactionChain((void *) stmt, CREATE DATABASE);
 PreventTransactionChain((void *) dbname, DROP DATABASE);
 PreventTransactionChain((void *) stmt, CLUSTER);
 PreventTransactionChain((void *) dbname, REINDEX DATABASE);
 PreventTransactionChain((void *) vacstmt, stmttype);
 PreventTransactionChain((void *) stmt, CREATE TABLESPACE);
 PreventTransactionChain((void *) stmt, DROP TABLESPACE);

 Handling the multi-keyword cases is going to take a nontrivial increment
 of functionality.  Perhaps while we're at it, we could teach this code
 about nested /* comments ...

Currently there is no need for nested comments, because those are only
single word queries. Or do I not understand what you mean by nested
comments? (There is code for ignore /* .. */ before the first keyword.)

Any suggestion how to that? I can think of a way myself, but it may not be
the best, as I don't consider C my natural language. I can try, or does
anyone else feel inclined to fix this?

Best Regards,
Michael Paesold


---(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


[PATCHES] documentation fixes

2004-09-19 Thread Neil Conway
The attached patch makes some minor improvements and cleanup to the
docs. Patch applied to HEAD.

-Neil

Index: doc/src/sgml/ref/create_operator.sgml
===
RCS file: /Users/neilc/local/cvs/pgsql-server/doc/src/sgml/ref/create_operator.sgml,v
retrieving revision 1.42
diff -c -r1.42 create_operator.sgml
*** doc/src/sgml/ref/create_operator.sgml	25 Jun 2004 21:55:50 -	1.42
--- doc/src/sgml/ref/create_operator.sgml	18 Sep 2004 02:07:29 -
***
*** 262,270 
/para
  
para
!Use commandDROP OPERATOR/command to delete user-defined
!operators from a database.  Use commandALTER OPERATOR/command
!to modify operators in a database.
/para
   /refsect1

--- 262,272 
/para
  
para
!Use xref linkend=sql-dropoperator
!endterm=sql-dropoperator-title to delete user-defined operators
!from a database.  Use xref linkend=sql-alteroperator
!endterm=sql-alteroperator-title to modify operators in a
!database.
/para
   /refsect1

Index: doc/src/sgml/ref/deallocate.sgml
===
RCS file: /Users/neilc/local/cvs/pgsql-server/doc/src/sgml/ref/deallocate.sgml,v
retrieving revision 1.5
diff -c -r1.5 deallocate.sgml
*** doc/src/sgml/ref/deallocate.sgml	29 Nov 2003 19:51:38 -	1.5
--- doc/src/sgml/ref/deallocate.sgml	18 Sep 2004 02:05:34 -
***
*** 71,76 
--- 71,85 
 statement, but it is only for use in embedded SQL.
/para
   /refsect1
+ 
+  refsect1
+   titleSee Also/title
+ 
+   simplelist type=inline
+memberxref linkend=sql-execute endterm=sql-execute-title/member
+memberxref linkend=sql-prepare endterm=sql-prepare-title/member
+   /simplelist
+  /refsect1
  /refentry
  
  !-- Keep this comment at the end of the file
Index: doc/src/sgml/ref/drop_trigger.sgml
===
RCS file: /Users/neilc/local/cvs/pgsql-server/doc/src/sgml/ref/drop_trigger.sgml,v
retrieving revision 1.18
diff -c -r1.18 drop_trigger.sgml
*** doc/src/sgml/ref/drop_trigger.sgml	29 Nov 2003 19:51:38 -	1.18
--- doc/src/sgml/ref/drop_trigger.sgml	18 Sep 2004 02:10:02 -
***
*** 51,58 
  termreplaceable class=PARAMETERtable/replaceable/term
  listitem
   para
!   The name (optionally schema-qualified) of a table for which the
!   trigger is defined.
   /para
  /listitem
 /varlistentry
--- 51,58 
  termreplaceable class=PARAMETERtable/replaceable/term
  listitem
   para
!   The name (optionally schema-qualified) of the table for which
!   the trigger is defined.
   /para
  /listitem
 /varlistentry
Index: doc/src/sgml/ref/execute.sgml
===
RCS file: /Users/neilc/local/cvs/pgsql-server/doc/src/sgml/ref/execute.sgml,v
retrieving revision 1.10
diff -c -r1.10 execute.sgml
*** doc/src/sgml/ref/execute.sgml	22 Apr 2004 11:46:22 -	1.10
--- doc/src/sgml/ref/execute.sgml	18 Sep 2004 02:06:16 -
***
*** 105,110 
--- 105,119 
 syntax.
/para
   /refsect1
+ 
+  refsect1
+   titleSee Also/title
+ 
+   simplelist type=inline
+memberxref linkend=sql-deallocate endterm=sql-deallocate-title/member
+memberxref linkend=sql-prepare endterm=sql-prepare-title/member
+   /simplelist
+  /refsect1
  /refentry
  
  !-- Keep this comment at the end of the file
Index: doc/src/sgml/ref/postmaster.sgml
===
RCS file: /Users/neilc/local/cvs/pgsql-server/doc/src/sgml/ref/postmaster.sgml,v
retrieving revision 1.51
diff -c -r1.51 postmaster.sgml
*** doc/src/sgml/ref/postmaster.sgml	11 Jul 2004 00:18:41 -	1.51
--- doc/src/sgml/ref/postmaster.sgml	19 Sep 2004 03:31:17 -
***
*** 84,90 
 point to a directory containing only configuration files:
 filenamepostgresql.conf/, filenamepg_hba.conf/, and
 filenamepg_ident.conf/. You can then set
!filenamepostgresql.conf/'s varnamepgdata/ to point to the
 data directory. You can also point just to the server configuration file
 like filenamepostgresql.conf/ and set its variables to point to the
 other configuration files and the data directory.
--- 84,90 
 point to a directory containing only configuration files:
 filenamepostgresql.conf/, filenamepg_hba.conf/, and
 filenamepg_ident.conf/. You can then set
!filenamepostgresql.conf/'s varnamepgdata/ variable to point to the
 data directory. You can also point just to the server configuration file
 like filenamepostgresql.conf/ and set its variables to point to the
 other configuration files and the data directory.
***
*** 164,171 
termoption-F/option/term
listitem
 para
! Disables functionfsync/function calls for performance
!

[PATCHES] small doc patch for postgresql.conf.sample

2004-09-19 Thread Josh Berkus
Bruce,

Re-building CVS I noticed that I never submitted this doc-only patch to 
postgresql.conf.sample.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco
Index: postgresql.conf.sample
===
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/postgresql.conf.sample,v
retrieving revision 1.127
diff -c -r1.127 postgresql.conf.sample
*** postgresql.conf.sample	31 Aug 2004 04:53:44 -	1.127
--- postgresql.conf.sample	20 Sep 2004 00:58:28 -
***
*** 11,16 
--- 11,19 
  # allowed values can be found in the PostgreSQL documentation. The
  # commented-out settings shown in this file represent the default values.
  #
+ # Please note that re-commenting values does NOT revert them to the
+ # default values.
+ #
  # Any option can also be given as a command line switch to the
  # postmaster, e.g. 'postmaster -c log_connections=on'. Some options
  # can be changed at run-time with the 'SET' SQL command.
***
*** 18,24 
  # This file is read on postmaster startup and when the postmaster
  # receives a SIGHUP. If you edit the file on a running system, you have 
  # to SIGHUP the postmaster for the changes to take effect, or use 
! # pg_ctl reload.
  
  
  #---
--- 21,28 
  # This file is read on postmaster startup and when the postmaster
  # receives a SIGHUP. If you edit the file on a running system, you have 
  # to SIGHUP the postmaster for the changes to take effect, or use 
! # pg_ctl reload.   Some settings, such as listen_address, require
! # a full shutdown and restart to take effect.
  
  
  #---

---(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