Skip site navigation (1) Skip section navigation (2)

Re: Patch to add typmod's functions to a type's creation statement

From: Dave Page <dpage(at)postgresql(dot)org>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Patch to add typmod's functions to a type's creation statement
Date: 2007-11-26 10:50:50
Message-ID: 474AA50A.3080702@postgresql.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Guillaume Lelarge wrote:
> Hi all,
> 
> Here is a patch to support this new PostgreSQL 8.3 feature : the
> possibility to add type modifier input and ouput functions to a newly
> created type.

Unfortunately this still needs some work. I found the following issues:

- The typemod in/out functions are not included the reverse engineered
SQL displayed on the main window when a type with such functions is
selected (for reference, try pg_catalog.time).

- I'm not so keen on the labelling. I would suggest:

  'Typmod in function'/'Typmod out function' in the properties list.
  'Typmod in func'/'Typmod out func' on dlgType.

- The code that loads the combo boxes in dlgType is broken. It's
currently in loop designed to load the I/O and Send/Receive functions
(which is somewhat broken in itself). The doc at
http://www.postgresql.org/docs/8.3/static/sql-createtype.html describes
the general signature of functions that are appropriate.

[as a side note, the code here seems somewhat broken in general wrt the
handling of the whole create function/create type chicken and egg
scenario - I'll make a note to review that]

> I tried many things but wasn't able to test it. If someone has an
> example of a use of this statement, can he send it to me or can he test
> my patch ? Thanks.

Look at the code for the time datatype in pg_catalog. You can create
your own experimental types from it's reverse-engineers SQL (once the
first item above is fixed).

Patch NOT applied.

Regards, Dave.

In response to

Responses

pgadmin-hackers by date

Next:From: svnDate: 2007-11-26 16:29:01
Subject: SVN Commit by dpage: r6828 - trunk/pgadmin3
Previous:From: Raphaƫl EnriciDate: 2007-11-25 11:04:05
Subject: Re: pgadmin3 1.8.0 for ubuntu/dapper and

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group