Re: Updates of SE-PostgreSQL 8.4devel patches (r1389) - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Re: Updates of SE-PostgreSQL 8.4devel patches (r1389)
Date
Msg-id 4965563B.1090801@ak.jp.nec.com
Whole thread Raw
In response to Re: Updates of SE-PostgreSQL 8.4devel patches (r1389)  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Updates of SE-PostgreSQL 8.4devel patches (r1389)  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
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 <kaigai@ak.jp.nec.com>


pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: New patch for Column-level privileges
Next
From: Bruce Momjian
Date:
Subject: Re: Potential Join Performance Issue