Alvaro Herrera wrote:
> Agreed, it seems better.  The attached patch adds that, a macro you
> originally requested and another one, and it also fixes an off-by-one
> bug I discovered while testing all of this.  I also attach the testing
> patch I play with to check that this all works nicely.

| *** src/include/access/reloptions.h   6 Jan 2009 14:47:37 -0000       1.8
| --- src/include/access/reloptions.h   7 Jan 2009 13:31:25 -0000
| ***************
| *** 90,100 ****
| --- 90,103 ----
|       double          max;
|   } relopt_real;
|
| + typedef void (*validate_string_relopt) (char *);
| +
|   typedef struct relopt_string
|   {
|       relopt_gen      gen;
|       int                     default_len;
|       bool            default_isnull;
| +     validate_string_relopt  validate_cb;
|       char            default_val[1]; /* variable length */
|   } relopt_string;

Could you deliver "bool validate" to the validate_string_relopt callback?
In this specification, invoked callback cannot know whether it should
really raise an error for invalid reloption, or not.

I prefer:
    typedef void (*validate_string_relopt) (char *value, bool validate);

> Oh, the patch also removes a bunch of "continue" statements that, as far
> as I can tell, no longer work after the macros were wrapped in
> do { ... } while (0) :-(  I don't see any nice way to put the facility
> back.
> 
> Thanks for all the input.

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kai...@ak.jp.nec.com>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to