<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>When you do a “select” instead
of a “values” statement for the values to insert, you shouldn’t
have the parentheses around the select column names. I.E>:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Insert into tinytable (tinyid, tinyname)
select bigid, bigname from bigtable;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>IS GOOD, WHILE <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Insert into tinytable (tinyid, tinyname)
select ( bigid, bigname ) from bigtable;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>IS BAD.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>HTH,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>r.b.<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Ezequias Rodrigues da Rocha<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 23, 2006
12:10 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">PostGIS
 Users Discussion</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [postgis-users]
Insert [off-topic]</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>Mark,<br>
<br>
I tryed what you recommended but I got another strange error again:<br>
</span></font><font size=2><span style='font-size:10.0pt'><br>
<b><span style='font-weight:bold'>insert into</span></b> </span></font><font
size=2 color="#009900"><span style='font-size:10.0pt;color:#009900'>imoveis</span></font><font
size=2><span style='font-size:10.0pt'>  (dsqf,
atividade,natureza,cod_lograd,num_imov,subunidade,num_bloco, bloco, tipo_subun,
propriet, area_terre, area_total,area_unida,test_princ, test_fict,patrimonio,
muro,calcada,pedologia,
topografia,formato,tip_estrut,tip_edif,acabamento,est_constr,pavimentac,geocodigo,inscricao,sequencial, 
planta, quadra, desc_impo,cod_impo,desc_limpe,cod_limpe,desc_ilumi,
cod_ilumi,pontos_vu, log_tipo,
log_titulo,log_prepos,nome_do_lo,razao,fantazia,cgc,desc_ativi,codbairro,nomebairro,
zona,zona_nome, preserva,coleta,dtcadastro,dthabit )  </span></font><font
size=2 color="#009900"><span style='font-size:10.0pt;color:#009900'>select</span></font><font
size=2><span style='font-size:10.0pt'>
(dsqf,atividade,natureza,cod_lograd,num_imov,subunidade,num_bloco, bloco,
tipo_subun, propriet, area_terre, area_total,area_unida,test_princ,
test_fict,patrimonio, muro,calcada,pedologia,
topografia,formato,tip_estrut,tip_edif,acabamento,est_constr,pavimentac,geocodigo,inscricao,sequencial, 
planta, quadra, desc_impo,cod_impo,desc_limpe,cod_limpe,desc_ilumi,
cod_ilumi,pontos_vu, log_tipo,
log_titulo,log_prepos,nome_do_lo,razao,fantazia,cgc,desc_ativi,codbairro,nomebairro,
zona,zona_nome, preserva,coleta,dtcadastro,dthabit ) </span></font><font
size=2 color="#009900"><span style='font-size:10.0pt;color:#009900'>from</span></font><font
size=2><span style='font-size:10.0pt'> </span></font><font size=2
color="#009900"><span style='font-size:10.0pt;color:#009900'>imoveis3</span></font><font
size=2><span style='font-size:10.0pt'>;<br>
<br>
</span></font><font size=2 color="#cc0000"><span style='font-size:10.0pt;
color:#CC0000'>ERROR:  column "dsqf" is of type character
varying but expression is of type record<br>
HINT:  You will need to rewrite or cast the expression.</span></font><font
size=2><span style='font-size:10.0pt'><br>
dbpotgis=#<br>
</span></font><br>
And now friend ?<br>
<br>
<br>
<br>
Mark Cave-Ayland escreveu: <o:p></o:p></p>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><pre wrap=""><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>From: <a
href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>    <o:p></o:p></span></font></pre></blockquote>

<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>[<a
href="mailto:postgis-users-bounces@postgis.refractions.net">mailto:postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of Ezequias<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Rodrigues da Rocha<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>  <o:p></o:p></span></font></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><pre wrap=""><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Sent: 23 March 2006 13:01<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>To: <st1:PersonName
w:st="on">PostGIS Users Discussion</st1:PersonName><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Subject: [postgis-users] Insert [off-topic]<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>    <o:p></o:p></span></font></pre></blockquote>

<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>(cut)<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>  <o:p></o:p></span></font></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><pre wrap=""><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>I am trying to add a table inside of another using this command line:<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>dbpotgis=# INSERT INTO imoveis select * from imoveis3;<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>ERROR:  value too long for type character varying(2)<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>But as you can see there is a small message that don't tell anything about<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>    <o:p></o:p></span></font></pre></blockquote>

<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>the problem.<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Hi Ezequias,<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>The message is telling you that you're trying to put a string longer than 2<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>characters into a varchar(2) column. The most likely cause is that you<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>aren't specifying the column list manually and the column order is different<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>between the two tables. You should be able to solve this by manually<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>specifying the order of your columns, for example:<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>        INSERT INTO imoveis (col1, col2... col3) SELECT col1, col2... col3<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>FROM imoveis3;<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Kind regards,<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Mark.<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>------------------------<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>WebBased Ltd<o:p></o:p></span></font></pre><pre><st1:Street
w:st="on"><st1:address w:st="on"><font size=2 color=black face="Courier New"><span
  style='font-size:10.0pt'>17 Research Way</span></font></st1:address></st1:Street><o:p></o:p></pre><pre><st1:City
w:st="on"><st1:place w:st="on"><font size=2 color=black face="Courier New"><span
  style='font-size:10.0pt'>Plymouth</span></font></st1:place></st1:City><o:p></o:p></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>PL6 8BT<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>T: +44 (0)1752 797131<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>F: +44 (0)1752 791023<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.webbased.co.uk">http://www.webbased.co.uk</a>  <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.infomapper.com">http://www.infomapper.com</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.swtc.co.uk">http://www.swtc.co.uk</a> <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>This email and any attachments are confidential to the intended recipient<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>and may also be privileged. If you are not the intended recipient please<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>delete it from your system and notify the sender. You should not copy it or<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>use it for any purpose nor disclose or distribute its contents to any other<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>person.<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>_______________________________________________<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>postgis-users mailing list<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>  <o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><br>
<br>
<o:p></o:p></span></font></p>

<pre><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>-- <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Ezequias Rodrigues da Rocha<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://ezequiasrocha.blogspot.com">http://ezequiasrocha.blogspot.com</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="mailto:msn:ezequias@hotmail.com">msn:ezequias@hotmail.com</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>"the worst of democracies is still better than the best of dictatorship"<o:p></o:p></span></font></pre></div>

</body>

</html>