Received: from netcom15.netcom.com (zalman@netcom15.netcom.com [192.100.81.128]) by hub.org (8.9.2/8.9.1) with ESMTP id TAA74708 for ; Sun, 7 Mar 1999 19:21:01 -0500 (EST) (envelope-from zalman@netcom.com) Received: (from zalman@localhost) by netcom15.netcom.com (8.8.5-r-beta/8.8.5/(NETCOM v1.02)) id QAA08433 for pgsql-sql@postgresql.org; Sun, 7 Mar 1999 16:21:00 -0800 (PST) From: Zalman Stern Message-Id: <199903080021.QAA08433@netcom15.netcom.com> Subject: "typedef" in Pstgresql? To: pgsql-sql@postgresql.org Date: Sun, 7 Mar 1999 16:21:00 -0800 (PST) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, I'm looking for a way to create a "typedef" from a name of my choosing to a basic type in Postgres. I would like to be able to set it up so that "boolean" means the same thing as "bool", "string" means the same thing as "text", and "integer" means the same thing as "int4". (I have an app that expects this to be true.) It seems like this should be possible. One can easily add the types to the pg_type table, but this doesn't help to get the pg_operator table setup correctly and my attempts to do that break things very badly because all of the sudden, all sorts of queries are ambiguous and require extra casts. Is there a simple way to do this? Will just adding cast functions for the newly declared types to the correct internal types solve the problem? Is there a way to write a cast from "integer" to "int4" without doing an extension module in C? The data representations are bytewise exactly the same in each case of course. (If push comes to shove, I'll either write the extension module or modify the client code to remap typenames...) Thanks, -Z-