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

List:       postgresql-general
Subject:    Re: [HACKERS] 9.0beta2 - server crash when using HS + SR
From:       Bruce Momjian <bruce () momjian ! us>
Date:       2010-06-30 23:41:53
Message-ID: 201006302341.o5UNfrp07888 () momjian ! us
[Download RAW message or body]

Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > The attached patch shows the hint only during recovery.
> 
> BTW, it would be easier and more consistent with the rest of the code to
> look at InRecovery, instead of messing around with the function
> signature.  And the usual way to emit a hint conditionally is
> 
> 	(InRecovery ? errhint(...) : 0)
> 
> rather than duplicate a lot of surrounding code.

Thanks for the "hints".   I was thinking there was a way to use ? : for
the hint, but couldn't find an example.  I see examples now.  Updated
patch attached.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +

["/pgpatches/tablespace" (/pgpatches/tablespace)]

Index: src/backend/commands/tablespace.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/commands/tablespace.c,v
retrieving revision 1.74
diff -c -c -r1.74 tablespace.c
*** src/backend/commands/tablespace.c	26 Feb 2010 02:00:39 -0000	1.74
--- src/backend/commands/tablespace.c	30 Jun 2010 22:45:21 -0000
***************
*** 552,559 ****
  		if (errno == ENOENT)
  			ereport(ERROR,
  					(errcode(ERRCODE_UNDEFINED_FILE),
! 					 errmsg("directory \"%s\" does not exist",
! 							location)));
  		else
  			ereport(ERROR,
  					(errcode_for_file_access(),
--- 552,560 ----
  		if (errno == ENOENT)
  			ereport(ERROR,
  					(errcode(ERRCODE_UNDEFINED_FILE),
! 					 errmsg("directory \"%s\" does not exist", location),
! 					 InRecovery ? errhint("Create directory \"%s\" for this tablespace before "
! 							 "restarting the server.", location) : 0));
  		else
  			ereport(ERROR,
  					(errcode_for_file_access(),


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