Search Postgresql Archives

Re: column "id" is of type integer but expression is of type character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you.

Well, you've dropped the integer column from test, so now the INSERT
command is trying to stuff the char(10) value from test into the integer
column in lisa - which is what the error message is telling you.

INSERT INTO test SELECT * FROM lisa;

I need that test table primary key column (id) values are populated
automatically with new ids from serial sequence, but all other column values
are duplicatated.

In reality those tables contain large number of columns and  some column
names may be not known at script creation time.

So it is not possible not create column list instead of *

How to force PostgreSql to match columns by name, not by position so that
this command will work ?

Andrus.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux