Re: [PATCHES] Basic subtransaction facility

2004-04-19 Thread Alvaro Herrera
On Mon, Apr 19, 2004 at 11:13:35AM -0400, Alvaro Herrera wrote:

> I noticed that I sent an old version because of a system crash (the
> *one* time I don't review vi -r differences it bites me ... argh).  It
> has several obvious mistakes.  Please do not waste your time reviewing
> that; I'll submit a corrected version later, which will also contain
> some more changes.

Ok, hopefully this one is better.

I'm thinking that I'll to add a new elog level to signal a can't-happen
condition within the transaction machinery, which would abort the whole
transaction tree (more than ERROR) but would not take the whole backend
down (less than FATAL).  What should it be called?  Do people agree that
it's needed?

-- 
Alvaro Herrera ()
"Et put se mouve" (Galileo Galilei)
Index: src/backend/access/transam/xact.c
===
RCS file: /home/alvherre/cvs/pgsql-server/src/backend/access/transam/xact.c,v
retrieving revision 1.165
diff -c -r1.165 xact.c
*** src/backend/access/transam/xact.c   5 Apr 2004 03:11:39 -   1.165
--- src/backend/access/transam/xact.c   20 Apr 2004 05:25:52 -
***
*** 189,194 
--- 189,224 
  static void RecordTransactionAbort(void);
  static void StartTransaction(void);
  
+ #ifdef SUBTRANSACTIONS
+ static void StartSubTransaction(void);
+ static void CommitSubTransaction(void);
+ static void AbortSubTransaction(void);
+ static void CleanupSubTransaction(void);
+ static void PushCurrentTransaction(void);
+ static void PopTransaction(void);
+ static bool IsSubTransaction(void);
+ static void ShowTransactionState(char *);
+ static void ShowTransactionStateRec(TransactionState, int);
+ 
+ static void AtSubStart_Memory(void);
+ static void AtSubCommit_Memory(void);
+ static void AtSubCleanup_Memory(void);
+ 
+ #else /* SUBTRANSACTIONS */
+ #define StartSubTransaction()
+ #define CommitSubTransaction()
+ #define AbortSubTransaction()
+ #define CleanupSubTransaction()
+ #define PushCurrentTransaction()
+ #define PopTransaction()
+ #define IsSubTransaction() (false)
+ #define ShowTransactionState(foo)
+ #define ShowTransactionStateRec()
+ #endif /* SUBTRANSACTIONS */
+ 
+ static char *BlockStateAsString(TBlockState);
+ static char *TransStateAsString(TransState);
+ 
  /*
   *global variables holding the current transaction state.
   */
***
*** 200,205 
--- 230,247 
TRANS_DEFAULT,  /* transaction state */
TBLOCK_DEFAULT  /* transaction block state from the 
client
 * perspective */
+ #ifdef SUBTRANSACTIONS
+   ,
+   0,  /* nesting level */
+   NULL,   /* commit memory context */
+   NULL,   /* deferred trigger queue */
+   NIL,/* smgr pending deletes */
+   NIL,/* async notifies */
+   NULL,   /* lightweight locks */
+   NIL,/* regular locks */
+   NULL,   /* parent transaction */
+ 
+ #endif
  };
  
  static TransactionState CurrentTransactionState = &CurrentTransactionStateData;
***
*** 281,287 
  {
TransactionState s = CurrentTransactionState;
  
!   if (s->blockState == TBLOCK_ABORT)
return true;
  
return false;
--- 323,330 
  {
TransactionState s = CurrentTransactionState;
  
!   if (s->blockState == TBLOCK_ABORT || 
!   s->blockState == TBLOCK_SUBABORT)
return true;
  
return false;
***
*** 452,459 
--- 495,544 
  ALLOCSET_DEFAULT_MAXSIZE);
  
MemoryContextSwitchTo(TopTransactionContext);
+ 
+   /*
+* This context will be used to hold data that survives
+* subtransaction commit but disappears on subtransaction end.
+* Most if not all of the transaction-local structures should
+* live here.
+*/
+   CommitContext = AllocSetContextCreate(TopTransactionContext,
+ 
"CommitContext",
+ 
ALLOCSET_DEFAULT_MINSIZE,
+ 
ALLOCSET_DEFAULT_INITSIZE,
+ 
ALLOCSET_DEFAULT_MAXSIZE);
  }
  
+ #ifdef SUBTRANSACTIONS
+ /* 
+  *StartSubTransaction stuff
+  

Re: [PATCHES] [JDBC] EXECUTE command tag returns actual command

2004-04-19 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes:
> Your patch has been added to the PostgreSQL unapplied patches list at:

> Kris Jurka wrote:
>> This patch makes the EXECUTE command's completion tag return the 
>> completion tag of the actual statement executed.

While I don't have any strong reason to object to this, the reason
Kris wanted it was to help let the JDBC driver use "EXECUTE prepared-stmt"
as its basic mechanism for executing pre-prepared statements --- and
there are a couple reasons why he should abandon that idea in favor of
using V3-protocol Bind/Execute messages.

If he goes over to using Bind/Execute then the JDBC driver will have no
need for this patch.  In that case we ought to stop and think whether
sticking to the existing behavior isn't the right thing to do; it wins
on backwards-compatibility grounds and we have no other use-cases saying
we should change.

Not a big complaint, but something to consider before applying.

regards, tom lane

PS: If you do apply, the EXECUTE reference page needs to have an
"Output" section added explaining that it returns a tag other than the
default "EXECUTE".

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] pg_restore ignore error patch v2

2004-04-19 Thread Bruce Momjian

Ah, this v2 version has the proper exit code.  Great.

---

Fabien COELHO wrote:
> 
> Dear patchers,
> 
> please find attached a small patch so that "pg_restore" ignores some sql
> errors. This is the second submission, which integrates Tom comments about
> localisation and exit code. I also added some comments about one sql
> command which is not ignored.
> 
> I tested it.
> 
> Have a nice day,
> 
> -- 
> Fabien Coelho - [EMAIL PROTECTED]

Content-Description: 

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
>http://archives.postgresql.org

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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

   http://archives.postgresql.org


Re: [PATCHES] pg_restore ignore error patch

2004-04-19 Thread Bruce Momjian
Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > I looked over the patch and it seems to continue on pg_restore errors by
> > default.  That isn't good.  By default, any error should make it exit
> > loudly.
> 
> I'm not sure of that.  pg_dump is really designed and tested for the
> case of text dump to a psql script, and if there is an error in the psql
> script, psql will print it out and continue.  In the cases I have seen
> where pg_restore operates differently from that paradigm, the pg_restore
> behavior of curling up and dying has *never* been the right thing.
> 
> I haven't looked at the details of Fabien's patch, but I'm in agreement
> with the overall goal.

Oh, OK, so make it behave like pg_dump's text output piped into psql.

The patch is quite clean and just changes die to warn for pg_restore,
and reports the number of errors on completion.

The only thing that it needs is to change pg_restore so it returns a
non-zero error if there were any warnings printed.  I can make that
change easily.

I will add it to the patch queue.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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

   http://archives.postgresql.org


Re: [PATCHES] pg_restore ignore error patch v2

2004-04-19 Thread Bruce Momjian

[ Newest version.]

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Fabien COELHO wrote:
> 
> Dear patchers,
> 
> please find attached a small patch so that "pg_restore" ignores some sql
> errors. This is the second submission, which integrates Tom comments about
> localisation and exit code. I also added some comments about one sql
> command which is not ignored.
> 
> I tested it.
> 
> Have a nice day,
> 
> -- 
> Fabien Coelho - [EMAIL PROTECTED]

Content-Description: 

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
>http://archives.postgresql.org

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] pg_restore ignore error patch

2004-04-19 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes:
> I looked over the patch and it seems to continue on pg_restore errors by
> default.  That isn't good.  By default, any error should make it exit
> loudly.

I'm not sure of that.  pg_dump is really designed and tested for the
case of text dump to a psql script, and if there is an error in the psql
script, psql will print it out and continue.  In the cases I have seen
where pg_restore operates differently from that paradigm, the pg_restore
behavior of curling up and dying has *never* been the right thing.

I haven't looked at the details of Fabien's patch, but I'm in agreement
with the overall goal.

regards, tom lane

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


Re: [PATCHES] pg_restore ignore error patch

2004-04-19 Thread Bruce Momjian
Fabien COELHO wrote:
> 
> Dear patchers,
> 
> please find a small patch submission so that "pg_restore" ignores some sql
> errors.
> 
> The implementation seems quite reasonnable to me, but pg-gods may have a
> different opinion. Two fields are added to the ArchiveHandler to trigger
> the behavior. A count summary of ignored sql errors is printed at the end
> of the restoration.
> 
> I did not fixed the "set session auth" attempt as option "-O" can already
> be used to avoid it.
> 
> It validates for me, but it seems that pg_dump/pg_restore is just *NOT*
> tested at all in the validation:-(. So at least I tested it.
> 
> My tests suggest that a feature of pg_restore is that it is only expected
> to work with its own server. Indeed, it generates some new syntax, such as
> $$ quoting, which is not compatible with older servers. This fact does not
> seem to appear in the documentation.

I looked over the patch and it seems to continue on pg_restore errors by
default.  That isn't good.  By default, any error should make it exit
loudly.

I can see value in having a flag that allows pg_restore to continue on
errors, particularly because only pg_restore can read binary dumps.  Do
folks get pg_restor failures frequently?  I sure hope not.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] minor readme patch for pg_autovacuum

2004-04-19 Thread Bruce Momjian

Patch applied.  Thanks.

---


Andrew Dunstan wrote:
> 
> The attached patch for contrib/pg_autovacuum/README.pg_autovacuum fixes 
> one apparent error and makes a minor stylistic change that makes it more 
> consistent and makes clear something that confused me :-)
> 
> cheers
> 
> andrew

> Index: contrib/pg_autovacuum/README.pg_autovacuum
> ===
> RCS file: /projects/cvsroot/pgsql-server/contrib/pg_autovacuum/README.pg_autovacuum,v
> retrieving revision 1.6
> diff -c -r1.6 README.pg_autovacuum
> *** contrib/pg_autovacuum/README.pg_autovacuum9 Nov 2003 03:15:46 -  
>  1.6
> --- contrib/pg_autovacuum/README.pg_autovacuum19 Apr 2004 15:51:00 -
> ***
> *** 110,119 
>   -D daemonize: Detach from tty and run in background.
>   -s sleep base value: see "Sleeping" below.
>   -S sleep scaling factor: see "Sleeping" below.
> ! -v vacuum base threshold: see Vacuum and Analyze.
> ! -V vacuum scaling factor: see Vacuum and Analyze.
> ! -a analyze base threshold: see Vacuum and Analyze.
> ! -A analyze scaling factor: see Vacuum and Analyze.
>   -L log file: Name of file to which output is submitted, otherwise STDERR
>   -U username: Username pg_autovacuum will use to connect with, if not
>  specified the current username is used.
> --- 110,119 
>   -D daemonize: Detach from tty and run in background.
>   -s sleep base value: see "Sleeping" below.
>   -S sleep scaling factor: see "Sleeping" below.
> ! -v vacuum base threshold: see "Vacuum and Analyze" below.
> ! -V vacuum scaling factor: see "Vacuum and Analyze" below.
> ! -a analyze base threshold: see "Vacuum and Analyze" below.
> ! -A analyze scaling factor: see "Vacuum and Analyze" below.
>   -L log file: Name of file to which output is submitted, otherwise STDERR
>   -U username: Username pg_autovacuum will use to connect with, if not
>  specified the current username is used.
> ***
> *** 129,135 
>   -v 1000
>   -V 2   
>   -a 500 (half of -v if not specified)
> ! -A 1   (half of -v if not specified)
>   -s 300 (5 minutes)
>   -S 2
>   
> --- 129,135 
>   -v 1000
>   -V 2   
>   -a 500 (half of -v if not specified)
> ! -A 1   (half of -V if not specified)
>   -s 300 (5 minutes)
>   -S 2
>   

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

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] minor readme patch for pg_autovacuum

2004-04-19 Thread Matthew T. O'Connor
Andrew Dunstan wrote:

***
*** 129,135 
 -v 1000
 -V 2   
 -a 500 (half of -v if not specified)
! -A 1   (half of -v if not specified)
 -s 300 (5 minutes)
 -S 2
 
--- 129,135 
 -v 1000
 -V 2   
 -a 500 (half of -v if not specified)
! -A 1   (half of -V if not specified)
 -s 300 (5 minutes)
 -S 2

Oops... good catch.

---(end of broadcast)---
TIP 8: explain analyze is your friend


[PATCHES] Fix for socket error msgs on win32

2004-04-19 Thread Magnus Hagander
Per discussion earlier today, here is a fix that lets ereport() on win32
report socket errors.


//Magnus


 <> 


win32_socketerror.patch
Description: win32_socketerror.patch

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] win32 fixes

2004-04-19 Thread Bruce Momjian

Newest version of patch applied.  Thanks.

---


Claudio Natoli wrote:
> 
> For application to HEAD, following community review.
> 
> * Most changes are to fix warnings issued when compiling win32
> * removed a few redundant defines
> * get_user_name safe under win32
> * rationalized pipe read EINTR for win32
> * changed all backend instances of sleep() to pg_usleep
> - except for the SLEEP_ON_ASSERT in assert.c, as it would exceed a
> 32-bit long [Note to patcher: If a SLEEP_ON_ASSERT of 2000 seconds is
> acceptable, please replace with pg_usleep(20L)]
> 
> 
> 
> 
> 
> 
> --- 
> Certain disclaimers and policies apply to all email sent from Memetrics.
> For the full text of these disclaimers and policies see 
>  href="http://www.memetrics.com/emailpolicy.html";>http://www.memetrics.com/em
> ailpolicy.html
>   
> 

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faqs/FAQ.html

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


[PATCHES] CSV patch applied

2004-04-19 Thread Bruce Momjian
I have applied the attached patch that complete TODO item:

o -Allow dump/load of CSV format

This adds new keywords to COPY and \copy:

CSV - enable CSV mode
QUOTE - specify quote character
ESCAPE - specify escape character
FORCE - force quoting of specified columns
LITERAL - prevent NULL checks for specific columns

If folks have better ideas for naming of those keywords, I am all ears!

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/ref/copy.sgml
===
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/copy.sgml,v
retrieving revision 1.55
diff -c -c -r1.55 copy.sgml
*** doc/src/sgml/ref/copy.sgml  13 Dec 2003 23:59:07 -  1.55
--- doc/src/sgml/ref/copy.sgml  19 Apr 2004 17:07:42 -
***
*** 26,32 
[ BINARY ] 
[ OIDS ]
[ DELIMITER [ AS ] 'delimiter' ]
!   [ NULL [ AS ] 'null string' ] 
]
  
  COPY tablename [ ( column [, ...] ) ]
  TO { 'filename' | STDOUT }
--- 26,35 
[ BINARY ] 
[ OIDS ]
[ DELIMITER [ AS ] 'delimiter' ]
!   [ NULL [ AS ] 'null string' ]
!   [ CSV [ QUOTE [ AS ] 'quote' 
] 
! [ ESCAPE [ AS ] 'escape' ]
! [ LITERAL column [, 
...] ]
  
  COPY tablename [ ( column [, ...] ) ]
  TO { 'filename' | STDOUT }
***
*** 34,40 
[ BINARY ]
[ OIDS ]
[ DELIMITER [ AS ] 'delimiter' ]
!   [ NULL [ AS ] 'null string' ] 
]
  
   
   
--- 37,46 
[ BINARY ]
[ OIDS ]
[ DELIMITER [ AS ] 'delimiter' ]
!   [ NULL [ AS ] 'null string' ]
!   [ CSV [ QUOTE [ AS ] 'quote' 
] 
! [ ESCAPE [ AS ] 'escape' ]
! [ FORCE column [, ...] ]
  
   
   
***
*** 146,152 
  
   
The single character that separates columns within each row
!   (line) of the file.  The default is a tab character.
   
  
 
--- 152,159 
  
   
The single character that separates columns within each row
!   (line) of the file.  The default is a tab character in text mode,
!   a comma in CSV mode.
   
  
 
***
*** 156,175 
  
   
The string that represents a null value. The default is
!   \N (backslash-N). You might prefer an empty
!   string, for example.
   
  
   

!On a COPY FROM, any data item that matches
 this string will be stored as a null value, so you should make
 sure that you use the same string as you used with
 COPY TO.

   
  
 

   
  
--- 163,248 
  
   
The string that represents a null value. The default is
!   \N (backslash-N) in text mode, and a empty
!   value with no quotes in CSV mode. You might prefer an
!   empty string even in text mode for cases where you don't want to
!   distinguish nulls from empty strings.
   
  
   

!When using COPY FROM, any data item that matches
 this string will be stored as a null value, so you should make
 sure that you use the same string as you used with
 COPY TO.

   
+ 
  
 
+ 
+
+ CSV
+ 
+  
+   Enables Comma Separated Variable (CSV) mode.  (Also called
+   Comma Separated Value).  It sets the default DELIMITER to 
+   comma, and QUOTE and ESCAPE values to 
+   double-quote.
+  
+ 
+
+ 
+
+ quote
+ 
+  
+   Specifies the quotation character in CSV mode.
+   The default is double-quote.
+  
+ 
+
+ 
+
+ escape
+ 
+  
+   Specifies the character that should appear before a QUOTE
+   data character value in CSV mode.  The default is the
+   QUOTE value (usually double-quote).
+  
+ 
+
+ 
+
+ FORCE
+ 
+  
+   In CSV COPY TO mode, forces quoting
+   to be used for all non-NULL values in each specified 
+   column.  NULL output is never quoted.
+  
+ 
+
+ 
+
+ LITERAL
+ 
+  
+   In CSV COPY FROM mode, for each column specified,
+   do not do a null string comparison;  instead load the value 
+   literally.  QUOTE and ESCAPE processing are still
+   performed.
+  
+  
+   If the null string is '' (the default 
+   in CSV mode), a missing input value (delimiter, 
+   delimiter), will load as a zero-length string.  Delimiter, quote, 
+   quote, delimiter is always treated as a zero-length string on input.
+  
+ 
+
+ 

   
  
**

[PATCHES] minor readme patch for pg_autovacuum

2004-04-19 Thread Andrew Dunstan
The attached patch for contrib/pg_autovacuum/README.pg_autovacuum fixes 
one apparent error and makes a minor stylistic change that makes it more 
consistent and makes clear something that confused me :-)

cheers

andrew
Index: contrib/pg_autovacuum/README.pg_autovacuum
===
RCS file: /projects/cvsroot/pgsql-server/contrib/pg_autovacuum/README.pg_autovacuum,v
retrieving revision 1.6
diff -c -r1.6 README.pg_autovacuum
*** contrib/pg_autovacuum/README.pg_autovacuum  9 Nov 2003 03:15:46 -   1.6
--- contrib/pg_autovacuum/README.pg_autovacuum  19 Apr 2004 15:51:00 -
***
*** 110,119 
  -D daemonize: Detach from tty and run in background.
  -s sleep base value: see "Sleeping" below.
  -S sleep scaling factor: see "Sleeping" below.
! -v vacuum base threshold: see Vacuum and Analyze.
! -V vacuum scaling factor: see Vacuum and Analyze.
! -a analyze base threshold: see Vacuum and Analyze.
! -A analyze scaling factor: see Vacuum and Analyze.
  -L log file: Name of file to which output is submitted, otherwise STDERR
  -U username: Username pg_autovacuum will use to connect with, if not
 specified the current username is used.
--- 110,119 
  -D daemonize: Detach from tty and run in background.
  -s sleep base value: see "Sleeping" below.
  -S sleep scaling factor: see "Sleeping" below.
! -v vacuum base threshold: see "Vacuum and Analyze" below.
! -V vacuum scaling factor: see "Vacuum and Analyze" below.
! -a analyze base threshold: see "Vacuum and Analyze" below.
! -A analyze scaling factor: see "Vacuum and Analyze" below.
  -L log file: Name of file to which output is submitted, otherwise STDERR
  -U username: Username pg_autovacuum will use to connect with, if not
 specified the current username is used.
***
*** 129,135 
  -v 1000
  -V 2   
  -a 500 (half of -v if not specified)
! -A 1   (half of -v if not specified)
  -s 300 (5 minutes)
  -S 2
  
--- 129,135 
  -v 1000
  -V 2   
  -a 500 (half of -v if not specified)
! -A 1   (half of -V if not specified)
  -s 300 (5 minutes)
  -S 2
  

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


Re: [PATCHES] Basic subtransaction facility

2004-04-19 Thread Bruce Momjian

Patch withdrawn by author.

---

Alvaro Herrera wrote:
> Hackers,
> 
> Here is a very preliminar patch that allows the user to say "BEGIN"
> inside a transaction and have the system react accordingly.  This is
> only a modification to xact.c (and slightly to other places to allow it
> to work); the important functions are empty.
> 
> It compiles fine for me with both SUBTRANSACTIONS defined and not
> defined; when not defined, the behavior is the same as the current code.
> Please note that I have made some errors more fatal than they are now,
> as bugs in this code will have much worse effects than a flaw in the
> current transaction system.
> 
> One quick note: there are two ENDABORT states for a subtransaction,
> SUBENDABORT_OK and SUBENDABORT_ERROR.  They signal whether the parent
> transaction should be aborted after the child transaction finishes or
> not:  an aborted subtransaction where the user issues COMMIT should
> abort the parent transaction; if the user issues ROLLBACK, the parent
> can be allowed to continue.
> 
> 
> Please have a look and comment.  This file does not move a lot so I
> don't think it will suffer from a lot of code drift.
> 
> -- 
> Alvaro Herrera ()
> "I think my standards have lowered enough that now I think 'good design'
> is when the page doesn't irritate the living f*ck out of me." (JWZ)

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 3: if posting/reading through Usenet, please send an appropriate
>   subscribe-nomail command to [EMAIL PROTECTED] so that your
>   message can get through to the mailing list cleanly

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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


Re: [PATCHES] Basic subtransaction facility

2004-04-19 Thread Alvaro Herrera
On Sun, Apr 18, 2004 at 11:29:05AM -0400, Tom Lane wrote:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
> > If you want.  When not #defined, the behavior is the same as the current
> > code, so it shouldn't affect anything.  However I posted mainly so
> > people could comment on the modifications, and maybe Heikki Linnakangas
> > could see how it affects his two phase commit patch.
> 
> I have not reviewed it yet, but would like to do so before it goes in.

I noticed that I sent an old version because of a system crash (the
*one* time I don't review vi -r differences it bites me ... argh).  It
has several obvious mistakes.  Please do not waste your time reviewing
that; I'll submit a corrected version later, which will also contain
some more changes.

Thanks.

-- 
Alvaro Herrera ()
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

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