Commit Graph

5 Commits

Author SHA1 Message Date
Tom Lane 31edbadf4a Downgrade implicit casts to text to be assignment-only, except for the ones
from the other string-category types; this eliminates a lot of surprising
interpretations that the parser could formerly make when there was no directly
applicable operator.

Create a general mechanism that supports casts to and from the standard string
types (text,varchar,bpchar) for *every* datatype, by invoking the datatype's
I/O functions.  These new casts are assignment-only in the to-string direction,
explicit-only in the other, and therefore should create no surprising behavior.
Remove a bunch of thereby-obsoleted datatype-specific casting functions.

The "general mechanism" is a new expression node type CoerceViaIO that can
actually convert between *any* two datatypes if their external text
representations are compatible.  This is more general than needed for the
immediate feature, but might be useful in plpgsql or other places in future.

This commit does nothing about the issue that applying the concatenation
operator || to non-text types will now fail, often with strange error messages
due to misinterpreting the operator as array concatenation.  Since it often
(not always) worked before, we should either make it succeed or at least give
a more user-friendly error; but details are still under debate.

Peter Eisentraut and Tom Lane
2007-06-05 21:31:09 +00:00
Tom Lane 2822c7c0fc Make contrib/isn pass the opr_sanity sanity checks: add missing
commutator operators, and mark hash-opclass members as oprcanhash.
This is a pretty ugly, brute-force solution, but it seems that getting
rid of all these redundant-looking operators would require some tweaks
in the core operator-resolution code to behave nicely, and I'm not
willing to risk that just before RC1.
2006-11-24 18:44:37 +00:00
Tom Lane 363c8cf21f Remove accented characters in comments, to avoid failures when this
file is read with an incompatible client_encoding setting.  Per report
from Tim N. van der Leeuw.
2006-10-01 18:37:53 +00:00
Tom Lane 5e08e49637 contrib/isn updates from Jeremy Kronuz. 2006-09-10 20:45:17 +00:00
Tom Lane dff84dc762 Add contrib/isn module for ISBN/ISSN/EAN13/etc product numbers, and
remove the old isbn_issn module which is about to be obsoleted by EAN13.
contrib/isn is by Germán Méndez Bravo.  Our thanks to Garrett A. Wollman
for having written the original isbn_issn module.
2006-09-09 04:07:52 +00:00