Skip Menu |

This queue is for tickets about the Parse-Dia-SQL CPAN distribution.

Report information
The Basics
Id: 50906
Status: resolved
Priority: 0/
Queue: Parse-Dia-SQL

People
Owner: Nobody in particular
Requestors: edy.incoletti [...] logicsistemi.it
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.11_01
Fixed in: 0.12_01



Subject: INT2, INT4 and INT8 data type are not recognised
Converting a dia digram to postgres the data type SERIAL (INTEGER) and INT4 are not recognised as the same type and a foreign key that link the filds is not generated. I think the same problem exists for INT2 and INT8 data type. These are not standard SQL, but are widely used.
On Wed Oct 28 05:17:29 2009, http://eincoletti.myopenid.com/ wrote: Show quoted text
> Converting a dia digram to postgres the data type SERIAL (INTEGER) and > INT4 are not recognised as the same type and a foreign key that link > the filds is not generated. > > I think the same problem exists for INT2 and INT8 data type. These are > not standard SQL, but are widely used.
Thank you for your bug report. Could you please attach a minimal dia diagram file with the version/platform used to create it, along with the actual and expected output from PDS. Best regards, Andreas --
On Mer. 11 Nov. 2009 04:42:13, AFF wrote: Show quoted text
> Thank you for your bug report. Could you please attach a minimal dia > diagram file with the version/platform used to create it, along with the > actual and expected output from PDS.
The attached Dia give the following error: [WARN] Attribute types (pk_main is SERIAL, fk_main is INT4) don't match in fk_detail_main (tbl_main,tbl_detail) And the foreign key is not generated. Dia 0.97 with postgres output. Have a nice day
-- Parse::SQL::Dia version 0.11_01 -- Documentation http://search.cpan.org/dist/Parse-Dia-SQL/ -- Environment Perl 5.010001, /usr/bin/perl -- Architecture i486-linux-gnu-thread-multi -- Target Database postgres -- Input file Test.dia -- Generated at Wed Nov 11 10:47:26 2009 -- get_constraints_drop -- get_permissions_drop -- get_view_drop -- get_schema_drop drop table tbl_main; drop table tbl_detail; -- get_smallpackage_pre_sql -- get_schema_create create table tbl_main ( pk_main SERIAL not null, constraint pk_tbl_main primary key (pk_main) ) ; create table tbl_detail ( pk_detail SERIAL not null, fk_main INT4 , constraint pk_tbl_detail primary key (pk_detail) ) ; -- get_view_create -- get_permissions_create -- get_inserts -- get_smallpackage_post_sql -- get_associations_create
Download Test.dia
application/x-dia-diagram 14.9k

Message body not shown because it is not plain text.

Parse::Dia::SQL::Utils::check_att_list_types checks that the foreign key column has the same data type as the column it refers to. Your problem seems to be that you want to use two different data types (INT4 and SERIAL), not that the INTX data types are unrecognized. The foreign key is generated if I change the tbl_main pk_main column to be INT4. I have not concluded yet whether this is a bug or indeed intended behavior. Regards, Andreas --
On Mer. 11 Nov. 2009 05:50:50, AFF wrote: Show quoted text
> Parse::Dia::SQL::Utils::check_att_list_types checks that the foreign key > column has the same data type as the column it refers to. Your problem > seems to be that you want to use two different data types (INT4 and > SERIAL), not that the INTX data types are unrecognized.
In postgres SERIAL, INTEGER and INT4 are the same data type. SMALLINT is synonym of INT2 and BIGINT of INT8. I think Parse-Dia-SQL shold only send a warning, but, in this cases, generate the foreign key.
On Wed Nov 11 06:05:46 2009, http://eincoletti.myopenid.com/ wrote: Show quoted text
> In postgres SERIAL, INTEGER and INT4 are the same data type. SMALLINT is > synonym of INT2 and BIGINT of INT8. > > I think Parse-Dia-SQL shold only send a warning, but, in this cases, > generate the foreign key.
Feel free to add functionality for data type synonyms, but remember it would have to be specific to each database. I will not pursue this on my own, but I will certainly consider patches, if any should arrive. Best regards, Andreas --
On Wed Nov 11 06:05:46 2009, http://eincoletti.myopenid.com/ wrote: Show quoted text
> In postgres SERIAL, INTEGER and INT4 are the same data type. SMALLINT is > synonym of INT2 and BIGINT of INT8.
Check out 0.12_01 and report if it's solves this issue.