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

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: <rod(at)iol(dot)ie>
Cc: "Richard Huxton" <dev(at)archonet(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: column "id" is of type integer but expression is of type character
Date: 2009-01-08 20:44:08
Message-ID: 2076C91A287B48FF999F24914749E0E9@andrusnotebook
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ray,

> I don't think you can - here's what the docs[1] for INSERT say:
>
> <quote from docs>
> The target column names can be listed in any order. If no list of column
> names is given at all, the default is all the columns of the table in
> their declared order; or the first N column names, if there are only N
> columns supplied by the VALUES clause or query. The values supplied by
> the VALUES clause or query are associated with the explicit or implicit
> column list left-to-right.
> </quote from docs>
>
> So it seems that the association between columns is based on order, not
> on name.

Solution seems to force id column to be last column in table.
In this case drop column id drops last columns and insert should work.

Any idea how to force id to be last column in table ?
Is it possible to create updatable view where id is last column ?

Andrus.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrej 2009-01-08 21:02:08 Re: Question about COPY command
Previous Message Filip Rembiałkowski 2009-01-08 20:43:51 Re: dblink between oracle and postgres?