pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCustom type
6+ messages / 5 participants
[nested] [flat]
* Custom type
@ 2006-03-22 20:25 Daniel Caune <daniel.caune@ubisoft.com>
2006-03-22 20:41 ` Re: Custom type Terry Lee Tucker <terry@esc1.com>
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Caune @ 2006-03-22 20:25 UTC (permalink / raw)
To: pgsql-sql
Hi,
How can I enter description for my custom types?
\dT provides information such as schema, name, and description for all
the registered types and custom types. I would like to provide a
description for each custom type I create.
Thanks,
--
Daniel CAUNE
Ubisoft Online Technology
(514) 4090 2040 ext. 5418
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Custom type
2006-03-22 20:25 Custom type Daniel Caune <daniel.caune@ubisoft.com>
@ 2006-03-22 20:41 ` Terry Lee Tucker <terry@esc1.com>
2006-03-22 21:07 ` Re: Custom type Bryce Nesbitt <bryce1@obviously.com>
0 siblings, 1 reply; 6+ messages in thread
From: Terry Lee Tucker @ 2006-03-22 20:41 UTC (permalink / raw)
To: pgsql-sql
On Wednesday 22 March 2006 03:25 pm, Daniel Caune saith:
> Hi,
>
> How can I enter description for my custom types?
>
> \dT provides information such as schema, name, and description for all
> the registered types and custom types. I would like to provide a
> description for each custom type I create.
>
> Thanks,
>
>
> --
> Daniel CAUNE
> Ubisoft Online Technology
> (514) 4090 2040 ext. 5418
>
Daniel,
From the \h command in psql:
rnd=# \h comment
Command: COMMENT
Description: define or change the comment of an object
Syntax:
COMMENT ON
{
TABLE object_name |
COLUMN table_name.column_name |
AGGREGATE agg_name (agg_type) |
CONSTRAINT constraint_name ON table_name |
DATABASE object_name |
DOMAIN object_name |
FUNCTION func_name (arg1_type, arg2_type, ...) |
INDEX object_name |
OPERATOR op (leftoperand_type, rightoperand_type) |
RULE rule_name ON table_name |
SCHEMA object_name |
SEQUENCE object_name |
TRIGGER trigger_name ON table_name |
TYPE object_name |
VIEW object_name
} IS 'text'
I believe this is what you need.
HTH.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Custom type
2006-03-22 20:25 Custom type Daniel Caune <daniel.caune@ubisoft.com>
2006-03-22 20:41 ` Re: Custom type Terry Lee Tucker <terry@esc1.com>
@ 2006-03-22 21:07 ` Bryce Nesbitt <bryce1@obviously.com>
2006-03-24 20:07 ` Re: Custom type george young <gry@ll.mit.edu>
0 siblings, 1 reply; 6+ messages in thread
From: Bryce Nesbitt @ 2006-03-22 21:07 UTC (permalink / raw)
To: pgsql-sql
Terry Lee Tucker wrote:
> rnd=# \h comment
> Command: COMMENT
> Description: define or change the comment of an object
> ..I believe this is what you need.
>
Cool!
That's a great feature. Though it would be even nicer if the comment
showed when
you "\d" a table::
stage=# comment on table db_version is 'Managed in nautilus.xml';
stage=# \d db_version
Table "public.db_version"
Column | Type | Modifiers
---------+-----------------------+-----------
version | character varying(64) |
stage=# \dd db_version
Object descriptions
Schema | Name | Object | Description
--------+------------+--------+-------------------------
public | db_version | table | Managed in nautilus.xml
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Custom type
2006-03-22 20:25 Custom type Daniel Caune <daniel.caune@ubisoft.com>
2006-03-22 20:41 ` Re: Custom type Terry Lee Tucker <terry@esc1.com>
2006-03-22 21:07 ` Re: Custom type Bryce Nesbitt <bryce1@obviously.com>
@ 2006-03-24 20:07 ` george young <gry@ll.mit.edu>
2006-03-24 20:58 ` Re: Custom type Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: george young @ 2006-03-24 20:07 UTC (permalink / raw)
To: pgsql-sql
On Wed, 22 Mar 2006 13:07:33 -0800
Bryce Nesbitt <bryce1@obviously.com> threw this fish to the penguins:
> Terry Lee Tucker wrote:
> > rnd=# \h comment
> > Command: COMMENT
> > Description: define or change the comment of an object
> > ..I believe this is what you need.
> >
> Cool!
> That's a great feature. Though it would be even nicer if the comment
> showed when
> you "\d" a table::
Hmm, it does(in 8.1.0) if you just say "\d+" without an argument:
newschm3=# comment on table fffg is 'the rain';
newschm3=# \d+
List of relations
Schema | Name | Type | Owner | Description
--------+--------------------------+-------+----------+-------------
public | fffg | table | postgres | the rain
public | group_run_limit | table | postgres |
public | hold_log | table | postgres |
...
But not if you specify the object:
newschm3=# \d+ fffg
Table "public.fffg"
Column | Type | Modifiers | Description
--------+---------+-----------+-------------
t | text | |
i | integer | |
This seems a bit like a bug to me...
-- George Young
> stage=# comment on table db_version is 'Managed in nautilus.xml';
> stage=# \d db_version
>
> Table "public.db_version"
> Column | Type | Modifiers
> ---------+-----------------------+-----------
> version | character varying(64) |
>
>
> stage=# \dd db_version
>
> Object descriptions
> Schema | Name | Object | Description
> --------+------------+--------+-------------------------
> public | db_version | table | Managed in nautilus.xml
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
--
"Are the gods not just?" "Oh no, child.
What would become of us if they were?" (CSL)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Custom type
2006-03-22 20:25 Custom type Daniel Caune <daniel.caune@ubisoft.com>
2006-03-22 20:41 ` Re: Custom type Terry Lee Tucker <terry@esc1.com>
2006-03-22 21:07 ` Re: Custom type Bryce Nesbitt <bryce1@obviously.com>
2006-03-24 20:07 ` Re: Custom type george young <gry@ll.mit.edu>
@ 2006-03-24 20:58 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2006-03-24 20:58 UTC (permalink / raw)
To: gry@ll.mit.edu; +Cc: pgsql-sql
george young <gry@ll.mit.edu> writes:
> But not if you specify the object:
> newschm3=# \d+ fffg
> Table "public.fffg"
> Column | Type | Modifiers | Description
> --------+---------+-----------+-------------
> t | text | |
> i | integer | |
> This seems a bit like a bug to me...
No, because that Description column is for comments on the individual
columns.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Custom type
@ 2006-03-22 21:10 Daniel Caune <daniel.caune@ubisoft.com>
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Caune @ 2006-03-22 21:10 UTC (permalink / raw)
To: Terry Lee Tucker <terry@esc1.com>; pgsql-sql
> > Hi,
> >
> > How can I enter description for my custom types?
> >
> > \dT provides information such as schema, name, and description for
all
> > the registered types and custom types. I would like to provide a
> > description for each custom type I create.
> >
> > Thanks,
> >
> >
> > --
> > Daniel CAUNE
> > Ubisoft Online Technology
> > (514) 4090 2040 ext. 5418
> >
>
> Daniel,
>
> From the \h command in psql:
>
> rnd=# \h comment
> Command: COMMENT
> Description: define or change the comment of an object
> Syntax:
> COMMENT ON
> {
> TABLE object_name |
> COLUMN table_name.column_name |
> AGGREGATE agg_name (agg_type) |
> CONSTRAINT constraint_name ON table_name |
> DATABASE object_name |
> DOMAIN object_name |
> FUNCTION func_name (arg1_type, arg2_type, ...) |
> INDEX object_name |
> OPERATOR op (leftoperand_type, rightoperand_type) |
> RULE rule_name ON table_name |
> SCHEMA object_name |
> SEQUENCE object_name |
> TRIGGER trigger_name ON table_name |
> TYPE object_name |
> VIEW object_name
> } IS 'text'
>
> I believe this is what you need.
>
> HTH.
>
I see! I was searching an option in the custom type creation statement,
something like:
CREATE TYPE foo (
...
)
DESCRIPTION "something that might be useful";
Thanks for this information!
--
Daniel
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2006-03-24 20:58 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-22 20:25 Custom type Daniel Caune <daniel.caune@ubisoft.com>
2006-03-22 20:41 ` Terry Lee Tucker <terry@esc1.com>
2006-03-22 21:07 ` Bryce Nesbitt <bryce1@obviously.com>
2006-03-24 20:07 ` george young <gry@ll.mit.edu>
2006-03-24 20:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-03-22 21:10 Re: Custom type Daniel Caune <daniel.caune@ubisoft.com>
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