X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id BDB5B9FB338 for ; Mon, 31 Jul 2006 10:16:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 86550-06 for ; Mon, 31 Jul 2006 10:15:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svana.org (svana.org [125.62.94.225]) by postgresql.org (Postfix) with ESMTP id 4148E9FB335 for ; Mon, 31 Jul 2006 10:15:33 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 4.50) id 1G7Xc8-00086Q-LI; Mon, 31 Jul 2006 23:15:20 +1000 Date: Mon, 31 Jul 2006 15:15:20 +0200 From: Martijn van Oosterhout To: Teodor Sigaev Cc: Pgsql Hackers Subject: Re: User-defined typle similar to char(length) varchar(length) Message-ID: <20060731131520.GE29868@svana.org> Reply-To: Martijn van Oosterhout References: <44CDFFC0.3070002@sigaev.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2qXFWqzzG3v1+95a" Content-Disposition: inline In-Reply-To: <44CDFFC0.3070002@sigaev.ru> X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: User-Agent: Mutt/1.5.9i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kleptog@svana.org X-SA-Exim-Scanned: No (on svana.org); SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.183 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: ** X-Archive-Number: 200607/1581 X-Sequence-Number: 87436 --2qXFWqzzG3v1+95a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 31, 2006 at 05:04:00PM +0400, Teodor Sigaev wrote: > Is it possible to create user-defined type with optional length in create= =20 > table similar to char()/varchar()/bit()? Without modification gram.y of= =20 > course... No. Search the archives for discussions about "user defined typmod". The basic problem came down too that the set of allowed words for functions and types would be forced to be the same (due to restrictions in lookahead), and people wern't happy with that because if may hamper future SQL compatability. There were ways around this (all fairly ugly though). Note: this is what I remember about the discussions anyway. I'm sure a lot of people would be happy if someone took this on though. Have a nice day, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to l= itigate. --2qXFWqzzG3v1+95a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFEzgJoIB7bNG8LQkwRAsuSAJ9UaUvHcsUBYIUGDoLu9ipfFPYhzQCfbuW0 5frgJHSVWQpqxJSDdPs5hcs= =sc+y -----END PGP SIGNATURE----- --2qXFWqzzG3v1+95a--