Skip site navigation (1) Skip section navigation (2)

Re: Npgsql MS 2.0 - char bug?

From: Andy Shellam <andy(at)andycc(dot)net>
To: jim(at)contactbda(dot)com, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Npgsql MS 2.0 - char bug?
Date: 2006-06-11 13:44:39
Message-ID: 448C1E47.5080503@andycc.net (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi Jim,

Thanks for the reply.

I've used char because the field data is always going to be 10
characters, without exception.  It's basically an ID field, which is
generated automatically by the field's default definition - and results
in values like DOM0000001, DOM0000002, DOM0000003 etc.

Andy

Jim Buttafuoco wrote:
> Andy,
> 
> char(10) is padded with spaces while varchar is not.  Don't you char(X) unless you need the padding
> 
> Jim
> 
> 
> ---------- Original Message -----------
> From: Andy Shellam <andy(at)andycc(dot)net>
> To: pgsql-interfaces(at)postgresql(dot)org
> Sent: Sun, 11 Jun 2006 12:32:50 +0100
> Subject: [INTERFACES] Npgsql MS 2.0 - char bug?
> 
>> Hi,
>>
>> I'm running the MS .NET 2.0 version of Npgsql (1.0RC1) with Visual Basic
>> 2005.
>>
>> My primary key (domain_id) in the "domain" table is defined as char(10).
>>
>> I have the query:
>>
>> UPDATE domain SET domain = :domain, last_updated_user = CURRENT_USER,
>> last_updated_date = NOW() WHERE domain_id = :domain_id;
>>
>> And the parameters are defined as:
>>
>> :domain -> Name: "domain"
>> 	-> Type: varchar
>> 	-> Size: 200
>> 	-> sourceColumn: "domain"
>>
>> :domain_id -> Name: "domain_id"
>> 	   -> Type: char
>> 	   -> Size: 10
>> 	   -> sourceColumn: "domain_id"
>>
>> That fails with the error "the UpdateCommand affected 0 of 1 rows
>> expected."  The same with the DeleteCommand.
>>
>> If I change the parameter ":domain_id" to...
>>
>> :domain_id -> Name: "domain_id"
>> 	   -> Type: varchar
>> 	   -> Size: 10
>> 	   -> sourceColumn: "domain_id"
>>
>> ... it works on both.
>>
>> Is this a bug, or am I missing something?
>>
>> Thanks
>>
>> Andy
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 4: Have you searched our list archives?
>>
>>                http://archives.postgresql.org
> ------- End of Original Message -------
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq
> 
> !DSPAM:14,448c098d256841132922231!
> 
> 


In response to

pgsql-interfaces by date

Next:From: Makarand KulkarniDate: 2006-06-17 05:10:12
Subject: Report Interface problem with Crystal Report 6.0
Previous:From: Jim ButtafuocoDate: 2006-06-11 12:15:35
Subject: Re: Npgsql MS 2.0 - char bug?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group