Re: using expression syntax for partition bounds - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: using expression syntax for partition bounds
Date
Msg-id 201901241200.mq5ysfrg2qzm@alvherre.pgsql
Whole thread Raw
In response to Re: using expression syntax for partition bounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: using expression syntax for partition bounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Why did you lose the parser_errposition in parse_utilcmd.c line 3854?

> -    /* Fail if we don't have a constant (i.e., non-immutable coercion) */
> -    if (!IsA(value, Const))
> +    /* Make sure the expression does not refer to any vars. */
> +    if (contain_var_clause(value))
>          ereport(ERROR,
> -                (errcode(ERRCODE_DATATYPE_MISMATCH),
> -                 errmsg("specified value cannot be cast to type %s for column \"%s\"",
> -                        format_type_be(colType), colName),
> -                 errdetail("The cast requires a non-immutable conversion."),
> -                 errhint("Try putting the literal value in single quotes."),
> -                 parser_errposition(pstate, con->location)));
> +                (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
> +                 errmsg("cannot use column references in partition bound expression")));


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Simplify set of flags used by MyXactFlags
Next
From: Dmitry Dolgov
Date:
Subject: Re: ArchiveEntry optional arguments refactoring