Обсуждение: BUG #4091: ECPG $select incompability with Informix

Поиск
Список
Период
Сортировка

BUG #4091: ECPG $select incompability with Informix

От
"Mikael Omma"
Дата:
The following bug has been logged online:

Bug reference:      4091
Logged by:          Mikael Omma
Email address:      mikael.omma@ge.com
PostgreSQL version: 8.2.6
Operating system:   SUSE Linux 10
Description:        ECPG $select incompability with Informix
Details:

ECPG "$select a, b, c into :a, :b, :c from table".
If in the db table the order of columns (b, a, c) this will not work.  I
have ESQL code from Informix ported to PostgreSQL.  In informix the order in
columns in the select query does not have to match the real order in the
table of the database.  Workaround is to reorder all columns in the ported
code.

Re: BUG #4091: ECPG $select incompability with Informix

От
Bruce Momjian
Дата:
Mikael Omma wrote:
>
> The following bug has been logged online:
>
> Bug reference:      4091
> Logged by:          Mikael Omma
> Email address:      mikael.omma@ge.com
> PostgreSQL version: 8.2.6
> Operating system:   SUSE Linux 10
> Description:        ECPG $select incompability with Informix
> Details:
>
> ECPG "$select a, b, c into :a, :b, :c from table".
> If in the db table the order of columns (b, a, c) this will not work.  I
> have ESQL code from Informix ported to PostgreSQL.  In informix the order in
> columns in the select query does not have to match the real order in the
> table of the database.  Workaround is to reorder all columns in the ported
> code.

No, we certainly don't require the SELECT target list to match the
column definition order.  You must be doing something else wrong, but we
can't tell because you didn't show us enough details.  Try what you want
in psql and you will see it works.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Re: BUG #4091: ECPG $select incompability with Informix

От
Michael Meskes
Дата:
On Fri, Apr 04, 2008 at 12:38:22PM +0000, Mikael Omma wrote:
> ECPG "$select a, b, c into :a, :b, :c from table".
> If in the db table the order of columns (b, a, c) this will not work.  I
> have ESQL code from Informix ported to PostgreSQL.  In informix the order in
> columns in the select query does not have to match the real order in the
> table of the database.  Workaround is to reorder all columns in the ported
> code.

I just created my own test case from this small bit of information and
it works flawlessly. Would you please care to elaborate?

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!