Redefining a column within a view
От | Schade, Jeffrey |
---|---|
Тема | Redefining a column within a view |
Дата | |
Msg-id | DB138660B6B01D458B16F9205C0C263427CFC117@ISOEMAILP3.iso.com обсуждение исходный текст |
Ответы |
Re: Redefining a column within a view
|
Список | pgsql-general |
We have a table which contains a 3 byte column with datatype CHAR(3)=0D=0Aw= hich we want to redefine within the view as a CHAR(1) column and a=0D=0ACHA= R(2) column. When I code the SUBSTR function the resulting column=0D=0Adata= type is TEXT. I would like to see the CHAR datatype, is there=0D=0Aanything= I can do to set the proper datatype. The sample view is below:=0D=0A=0D=0A= =20=0D=0A=0D=0ACREATE OR REPLACE VIEW schema.jeff=5Fview AS=20=0D=0A=0D=0A = SELECT col1 ,=0D=0A=0D=0A col2,=0D=0A=0D=0A S= ubstr(col3,1,1) as col3=5Fpart1,=0D=0A=0D=0A Substr(col3,2) = as col3=5Fpart2,=0D=0A=0D=0A col4=0D=0A=0D=0A FROM sche= ma.jeff=5Ftable;=0D=0A=0D=0A=20=0D=0A=0D=0AAny suggestions would be appreci= ated.=0D=0A=0D=0A=20=0D=0A=0D=0AJeff=0D=0A=0D=0A=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=0D=0AJeffrey Schade=20=0D=0A=0D=0ASystems Consultant,= Technology Engineering=0D=0A=0D=0A=0D=0AISO=0D=0A545 Washington Boulevard=0D= =0AJersey City, NJ 07310=0D=0AVoice: (201) 469-3738=0D=0A=0D=0A FAX: (201)= 748-1500 =20=0D=0Ajschade@iso.com <mailto:jschade@iso.com>=20=0D=0A=0D=0A =0D= =0A=0D=0AThis email is intended for the recipient only. If you are not the= intended recipient please disregard, and do not use the information for an= y purpose.=0D=0A
В списке pgsql-general по дате отправления: