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]

 



Richard,

Don't use SELECT * - list the columns you want to insert. I can't think
why you would do that (you'll end up with nulls in the id column) but it
will work.

In real table id is defined as

id serial primary key

so I excpect that it will be populated with correct values.
List of columns are not exactly known at script creation time (in customer sites customers may add additional columns to table),
so using column list is not possible.

Ony way seems to generates SELECT column list dynamically at run time, but I'm looking for nicer solution to force PostgreSql to match columns by name.

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