data type change on a view
| От | A. Kretschmer |
|---|---|
| Тема | data type change on a view |
| Дата | |
| Msg-id | 20071212181146.GB17415@a-kretschmer.de обсуждение исходный текст |
| Ответы |
Re: data type change on a view
|
| Список | pgsql-general |
Hello @all,
i have a question (rot really for myself, a member of ther german forum
asks):
i have two tables, contains a varchar(N)-column. Now i create a VIEW
based on this tables. The resulting view contains now a varchar without
length. How can i prevent this? How can i force that the column in the
view contains the *exact* typ?
Example:
test=# create table h1 (t varchar(8));
CREATE TABLE
test=*# create table h2 (t varchar(8));
CREATE TABLE
test=*# create view h as select t from h1 union all select t from h2;
CREATE VIEW
test=*# \d h
View "public.h"
Column | Type | Modifiers
--------+-------------------+-----------
t | character varying |
thx, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
В списке pgsql-general по дате отправления: