Thread: 1.15 Database Designer and character varying length option

1.15 Database Designer and character varying length option

From
Colin Beckingham
Date:
I was using the Database Designer to make a copy of the design of some 
tables in one db for inclusion in a new db. The process worked well 
except that one of the tables in the source has a number of 'character 
varying' type columns without length specifier. Postgresql seems quite 
happy with this in the source db, however in the generated SQL the 
fields are marked varchar(0) which kills the execution of the SQL in the 
destination db.

-- 
---
Colin Beckingham
613-454-5369
http://www.it4gh.com


Re: 1.15 Database Designer and character varying length option

From
Guillaume Lelarge
Date:
On Sat, 2012-04-21 at 05:15 -0400, Colin Beckingham wrote:
> I was using the Database Designer to make a copy of the design of some 
> tables in one db for inclusion in a new db. The process worked well 
> except that one of the tables in the source has a number of 'character 
> varying' type columns without length specifier. Postgresql seems quite 
> happy with this in the source db, however in the generated SQL the 
> fields are marked varchar(0) which kills the execution of the SQL in the 
> destination db.
> 

Well, there is a strange bug in database designer. It seems to be
confused with precision and length. Apparently, it mixes them. A
numeric(2,5) would appear as a numeric(5,2). I wouldn't be surprised if
your problem has something to do with this (DD using precision (which a
text type doesn't have) instead of length).

So, yes, yet another bug in the database designer. I kinda feel that the
database designer won't be available in 1.16 because of bugs, some
design issues, and a lack of time to fix them.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: 1.15 Database Designer and character varying length option

From
Colin Beckingham
Date:

On 04/21/2012 05:43 AM, Guillaume Lelarge wrote:
> On Sat, 2012-04-21 at 05:15 -0400, Colin Beckingham wrote:
>> I was using the Database Designer to make a copy of the design of some
>> tables in one db for inclusion in a new db. The process worked well
>> except that one of the tables in the source has a number of 'character
>> varying' type columns without length specifier. Postgresql seems quite
>> happy with this in the source db, however in the generated SQL the
>> fields are marked varchar(0) which kills the execution of the SQL in the
>> destination db.
>>
>
> Well, there is a strange bug in database designer. It seems to be
> confused with precision and length. Apparently, it mixes them. A
> numeric(2,5) would appear as a numeric(5,2). I wouldn't be surprised if
> your problem has something to do with this (DD using precision (which a
> text type doesn't have) instead of length).
>
> So, yes, yet another bug in the database designer. I kinda feel that the
> database designer won't be available in 1.16 because of bugs, some
> design issues, and a lack of time to fix them.
>

Not a problem. I think it is a valuable tool and provided one knows the
glitches it is worth taking the time to use the tool and work around them.

There is another issue which I can't quite figure out (ie it keeps 
cropping up but not in a consistent manner). It concerns a choice late 
in the process of SQL generation whereby you choose a schema or not a 
specific schema which affects your choices of what type of code is 
generated. A couple of times I have chosen a specific schema and come up 
with 'alter table' as default (correct), but also a couple of times I 
have chosen no schema which should allow it to simply default to 'create 
table'. It has done this correctly once or twice but just as often it 
comes up with 'alter table' as default (incorrect) and the matrix of 
table names/dropdown of action choice is not correctly formatted for 
column width or height (to accommodate multiple tables), with no 
vertical slider displayed. Resizing the dialog window does not help, 
however adjusting the width of a column does jerk the vertical slider 
into existence, only to disappear again after a change. As you can tell 
I do not have a good grasp of this behaviour yet but will keep trying to 
tie it down to something consistent. (Might be Gnome 3 again, who knows, 
time will tell.)

I'll try to grab some static images of what I see.

-- 
---
Colin Beckingham
613-454-5369
http://www.it4gh.com