From d2db166c7527552cc0ee6121fb32d11e14d36e97 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 4 Oct 2002 22:08:44 +0000 Subject: Require superuser privilege to create a binary-compatible cast, per discussion some weeks ago. Also, add a check that two types to be binary-equivalenced match as to typlen, typbyval, and typalign; if they don't then it's surely a mistake to equivalence them. --- doc/src/sgml/ref/create_cast.sgml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_cast.sgml b/doc/src/sgml/ref/create_cast.sgml index e64d696f81a..172b988a6af 100644 --- a/doc/src/sgml/ref/create_cast.sgml +++ b/doc/src/sgml/ref/create_cast.sgml @@ -1,4 +1,4 @@ - + @@ -81,10 +81,9 @@ SELECT 'The time is ' || now(); will be allowed only if the cast from type timestamp to text is marked AS IMPLICIT. Otherwise it - will be necessary to write one of + will be necessary to write the cast explicitly, for example SELECT 'The time is ' || CAST(now() AS text); -SELECT 'The time is ' || now()::text; (We generally use the term implicit cast to describe this kind of cast.) @@ -107,7 +106,9 @@ SELECT 'The time is ' || now()::text; To be able to create a cast, you must own the source or the target - data type. + data type. To create a binary-compatible cast, you must be superuser + (this restriction is made because an erroneous binary-compatible cast + conversion can easily crash the server). -- cgit v1.2.3