pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CREATE TYPE
3+ messages / 3 participants
[nested] [flat]

* CREATE TYPE
@ 2004-11-03 15:56 Ameen  - Etemady <eetemadi@ce.sharif.edu>
  2004-11-03 16:23 ` Re: CREATE TYPE Jeff <threshar@torgo.978.org>
  2004-11-04 06:30 ` Re: CREATE TYPE sad <sad@bankir.ru>
  0 siblings, 2 replies; 3+ messages in thread

From: Ameen - Etemady @ 2004-11-03 15:56 UTC (permalink / raw)
  To: pgsql-sql

I want to create a data type that have tow arguments in the defenition,
like the varchar type:
create table mytmp(name varchar(10));

I like to do it like this:
create table mytmp(name myvarchar(10,"en_US"));

whow can it be done by "CREATE TYPE"
I want to implement the internal functions (compare, ...).
I faunded the documentation but I can't see any thing that help me to
create a type same as varchar( with argument)

Notice: I don't mean using "CREATE TYPE myvarchar AS( lenght integer,
collate char(10))

Thanks



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CREATE TYPE
  2004-11-03 15:56 CREATE TYPE Ameen  - Etemady <eetemadi@ce.sharif.edu>
@ 2004-11-03 16:23 ` Jeff <threshar@torgo.978.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff @ 2004-11-03 16:23 UTC (permalink / raw)
  To: Ameen - Etemady <eetemadi@ce.sharif.edu>; +Cc: pgsql-sql


On Nov 3, 2004, at 10:56 AM, Ameen - Etemady wrote:
>
> I like to do it like this:
> create table mytmp(name myvarchar(10,"en_US"));
>
you can't unless you modify the parser.
It has special cases to support varchar (and numeric)  syntax.

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CREATE TYPE
  2004-11-03 15:56 CREATE TYPE Ameen  - Etemady <eetemadi@ce.sharif.edu>
@ 2004-11-04 06:30 ` sad <sad@bankir.ru>
  1 sibling, 0 replies; 3+ messages in thread

From: sad @ 2004-11-04 06:30 UTC (permalink / raw)
  To: Ameen - Etemady <eetemadi@ce.sharif.edu>; pgsql-sql

Hello

i note something related to this discussion

> create table mytmp(name myvarchar(10,"en_US"));

i meant that "en_US"  is a locale name, then it means natural language and 
also character encoding -- those both things are not a matter of SQL-TYPE at 
all. It is wrong to represent application specific data in SQL-TYPE itself.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-11-04 06:30 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-03 15:56 CREATE TYPE Ameen  - Etemady <eetemadi@ce.sharif.edu>
2004-11-03 16:23 ` Jeff <threshar@torgo.978.org>
2004-11-04 06:30 ` sad <sad@bankir.ru>

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