| From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
|---|---|
| To: | Rod Taylor <rbt(at)zort(dot)ca> |
| Cc: | Hackers List <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: pg_type defaults |
| Date: | 2002-02-20 16:24:32 |
| Message-ID: | 20020220082253.U836-100000@megazone23.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, 20 Feb 2002, Rod Taylor wrote:
> According to the system table documentation
> http://developer.postgresql.org/docs/postgres/catalog-pg-type.html the
> typdefault information is to be copied from the pg_type value to the
> table value when the default specified is NULL or a default is not
> specified.
>
> The below shows that it's not to be true.
>
>
> junk=# update pg_type set typdefault = 3 where typname = 'int2';
> UPDATE 1
> junk=# create table example (col1 int2);
> CREATE
> junk=# \d example
> Table "example"
> Column | Type | Modifiers
> --------+----------+-----------
> col1 | smallint |
Seems to work for me :)
insert into example default values;
select * from example;
col1
------
3
It doesn't show up in \d, but it is the default. I'd
also say this makes sense/is right since the type's default
is 3 and you don't have a default on the table.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Masaru Sugawara | 2002-02-20 17:02:46 | Re: Trouble with pg_dumpall import with 7.2 |
| Previous Message | Jean-Michel POURE | 2002-02-20 16:20:43 | Re: UTF-8 data migration problem in Postgresql 7.2 |