Re: column "id" is of type integer but expression is of type character - Mailing list pgsql-general

From Andrus
Subject Re: column "id" is of type integer but expression is of type character
Date
Msg-id 2076C91A287B48FF999F24914749E0E9@andrusnotebook
Whole thread Raw
In response to Re: column "id" is of type integer but expression is of type character  (Raymond O'Donnell <rod@iol.ie>)
List 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.


pgsql-general by date:

Previous
From: "Filip Rembiałkowski"
Date:
Subject: Re: dblink between oracle and postgres?
Next
From: Andrej
Date:
Subject: Re: Question about COPY command