pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zalman Stern <zalman@netcom.com>
To: pgsql-sql@postgresql.org
Subject: "typedef" in Pstgresql?
Date: Sun, 7 Mar 1999 16:21:00 -0800 (PST)
Message-ID: <199903080021.QAA08433@netcom15.netcom.com> (raw)

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-




view thread (3+ messages)  latest in thread

Message-ID: <199903080021.QAA08433@netcom15.netcom.com>
Permalink:  ../199903080021.QAA08433@netcom15.netcom.com/
Also on:    postgresql.org/message-id/199903080021.QAA08433@netcom15.netcom.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: zalman@netcom.com
  Subject: Re: "typedef" in Pstgresql?
  In-Reply-To: <199903080021.QAA08433@netcom15.netcom.com>
  References: <199903080021.QAA08433@netcom15.netcom.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox