diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-10-04 22:08:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-10-04 22:08:44 +0000 |
commit | d2db166c7527552cc0ee6121fb32d11e14d36e97 (patch) | |
tree | 0f35f6fe990922ffd7c0ce68f746e4ef709872ac /doc/src | |
parent | 04c57d68ce391847d6db9c3f96eaca365e296105 (diff) | |
download | postgresql-d2db166c7527552cc0ee6121fb32d11e14d36e97.tar.gz postgresql-d2db166c7527552cc0ee6121fb32d11e14d36e97.zip |
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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/create_cast.sgml | 9 |
1 files changed, 5 insertions, 4 deletions
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 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.5 2002/09/18 21:35:20 tgl Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.6 2002/10/04 22:08:44 tgl Exp $ --> <refentry id="SQL-CREATECAST"> <refmeta> @@ -81,10 +81,9 @@ SELECT 'The time is ' || now(); </programlisting> will be allowed only if the cast from type <type>timestamp</> to <type>text</type> is marked <literal>AS IMPLICIT</>. Otherwise it - will be necessary to write one of + will be necessary to write the cast explicitly, for example <programlisting> SELECT 'The time is ' || CAST(now() AS text); -SELECT 'The time is ' || now()::text; </programlisting> (We generally use the term <firstterm>implicit cast</firstterm> to describe this kind of cast.) @@ -107,7 +106,9 @@ SELECT 'The time is ' || now()::text; <para> 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). </para> <variablelist> |