Bad attributes order in alter script Postgresql 8.3

Hi i have noticed that when generating alter script for my database attributes order is wrong for some tables. That’s what is generated:

CREATE TABLE kir_oddzial_B44A88EC80DF41899CA7A0D01738945E(
kir_oddzial_id Varchar NOT NULL,
nazwa Varchar,
ulica Varchar,
kod Varchar,
miasto Varchar,
data_utworzenia Timestamp,
data_aktualizacji Timestamp,
kir_bank_id Integer NOT NULL
)
WITH (OIDS=FALSE)
;

That’s how table is actually defined in the model :

CREATE TABLE kir_oddzial(
kir_oddzial_id Varchar NOT NULL,
kir_bank_id Integer NOT NULL,
nazwa Varchar,
ulica Varchar,
kod Varchar,
miasto Varchar,
data_utworzenia Timestamp,
data_aktualizacji Timestamp
)
WITH (OIDS=FALSE)

In this case only one attribute is moved, however in some tables i get the attributes ordered completely backwards. That’s not a big issue, however it’s annoying cause when comparing model it now complains about attribute order.

Even when only change is attributes order alter script is still wrong.

I’m using Toad Data Modeler 3.6.6.7

Hi,

please make sure you don’t use sorting in grid on tab Attributes of Entity Properties Dialog. If you wish to reorder attributes, you need to use the green arrow icons at bottom of the dialog.

Try to edit your entity and click SQL preview to see the current order.

BTW: the first Create Table statement contains different table name than the second. Is that OK? I suppose it’s a temporary table, but would like to make sure you don’t have two tables with similar names in your model (could be reverse engineered).

Regards,

Vaclav

Well the second statement is from the SQL preview pane. Database creation script is generated fine.

As to the table name, TDD does generate temporary tables when something is changed in table schema. Then data is copied to temporary table and finally temp table is renamed as original, that temp table has wrong attributes order.

Hi,

we found some imperfections and will look into the matter. I created new change request for this - CR#81762.

Regards,

Vaclav

HI,

can ou send us sample models to modeling@quest.com please? We will use them for testing purposes only. Currently we are not able to reproduce problem with wrong attribute order.

Thank you,

Vaclav