Re: [GENERAL] Difference between CAST(v AS t) and v::t

2017-11-11 Thread Lele Gaifax
Tom Lane writes: > ... but expression-index syntax has the restriction that you need > parentheses around an expression unless it is, or at least looks like, > a function call. CAST() looks enough like a function call for this > purpose, v::t does not. > > I think there is

Re: [GENERAL] Difference between CAST(v AS t) and v::t

2017-11-11 Thread Tom Lane
Lele Gaifax writes: > while writing test cases for my SQL pretty printer tool[1], I found what seems > a discrepancy in the "Type Casts" documentation[2]: it states that the two > syntaxes are equivalent, but while They are functionally equivalent ... > EXCLUDE USING

[GENERAL] Difference between CAST(v AS t) and v::t

2017-11-11 Thread Lele Gaifax
Hi all, while writing test cases for my SQL pretty printer tool[1], I found what seems a discrepancy in the "Type Casts" documentation[2]: it states that the two syntaxes are equivalent, but while CREATE TABLE contracts ( ... company_id uuid NOT NULL, validity daterange NOT NULL,