mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Support reloptions of enum type
All our current in core relation options of type string (not many, admittedly) behave in reality like enums. But after seeing an implementation for enum reloptions, it's clear that strings are messier, so introduce the new reloption type. Switch all string options to be enums instead. Fortunately we have a recently introduced test module for reloptions, so we don't lose coverage of string reloptions, which may still be used by third-party modules. Authors: Nikolay Shaplov, Álvaro Herrera Reviewed-by: Nikita Glukhov, Aleksandr Parfenov Discussion: https://postgr.es/m/43332102.S2V5pIjXRx@x200m
This commit is contained in:
@ -38,24 +38,6 @@
|
||||
|
||||
static void checkViewTupleDesc(TupleDesc newdesc, TupleDesc olddesc);
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
* Validator for "check_option" reloption on views. The allowed values
|
||||
* are "local" and "cascaded".
|
||||
*/
|
||||
void
|
||||
validateWithCheckOption(const char *value)
|
||||
{
|
||||
if (value == NULL ||
|
||||
(strcmp(value, "local") != 0 &&
|
||||
strcmp(value, "cascaded") != 0))
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("invalid value for \"check_option\" option"),
|
||||
errdetail("Valid values are \"local\" and \"cascaded\".")));
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
* DefineVirtualRelation
|
||||
*
|
||||
|
Reference in New Issue
Block a user