Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

[GENERAL] data type change on a view

From: A. Kretschmer <andreas.kretschmer(at)schollglas.com>
Date: Wed Dec 12 2007 - 13:11:46 EST


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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               
http://www.postgresql.org/docs/faq
Received on Wed Dec 12 13:13:31 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 22:08:11 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library