Assert for frontend programs?

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-12-14T15:27:15Z
Lists: pgsql-hackers
As I'm working through the parallel dump patch, I notice this in one of 
the header files:

#ifdef USE_ASSERT_CHECKING
#define Assert(condition) \
     if (!(condition)) \
     { \
         write_msg(NULL, "Failed assertion in %s, line %d\n", \
                   __FILE__, __LINE__); \
         abort();\
     }
#else
#define Assert(condition)
#endif


I'm wondering if we should have something like this centrally (e.g. in 
postgres_fe.h)? I can certainly see people wanting to be able to use 
Assert in frontend programs generally, and it makes sense to me not to 
make everyone roll their own.

cheers

andrew