Re: pg_type defaults - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: pg_type defaults
Date
Msg-id 20020220082253.U836-100000@megazone23.bigpanda.com
Whole thread Raw
In response to pg_type defaults  ("Rod Taylor" <rbt@zort.ca>)
List 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.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [ODBC] UTF-8 data migration problem in Postgresql 7.2
Next
From: Jean-Michel POURE
Date:
Subject: Re: UTF-8 data migration problem in Postgresql 7.2