mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Support type modifiers for user-defined types, and pull most knowledge
about typmod representation for standard types out into type-specific typmod I/O functions. Teodor Sigaev, with some editorialization by Tom Lane.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.363 2006/12/23 00:52:40 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.364 2006/12/30 21:21:54 tgl Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "parser/gramparse.h"
|
||||
#include "parser/parse_expr.h"
|
||||
#include "parser/parse_relation.h"
|
||||
#include "parser/parse_type.h"
|
||||
#include "parser/scansup.h"
|
||||
#include "pgstat.h"
|
||||
#include "postmaster/autovacuum.h"
|
||||
@@ -4523,14 +4524,17 @@ flatten_set_variable_args(const char *name, List *args)
|
||||
* to interval and back to normalize the value and account
|
||||
* for any typmod.
|
||||
*/
|
||||
int32 typmod;
|
||||
Datum interval;
|
||||
char *intervalout;
|
||||
|
||||
typmod = typenameTypeMod(NULL, arg->typename, INTERVALOID);
|
||||
|
||||
interval =
|
||||
DirectFunctionCall3(interval_in,
|
||||
CStringGetDatum(val),
|
||||
ObjectIdGetDatum(InvalidOid),
|
||||
Int32GetDatum(arg->typename->typmod));
|
||||
Int32GetDatum(typmod));
|
||||
|
||||
intervalout =
|
||||
DatumGetCString(DirectFunctionCall1(interval_out,
|
||||
|
Reference in New Issue
Block a user