Re: using expression syntax for partition bounds

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, peter(dot)eisentraut(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: using expression syntax for partition bounds
Date: 2019-01-24 12:00:13
Message-ID: 201901241200.mq5ysfrg2qzm@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-01-24 12:12:40 Re: ArchiveEntry optional arguments refactoring
Previous Message Alvaro Herrera 2019-01-24 11:56:05 Re: Simplify set of flags used by MyXactFlags