pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Npgsql MS 2.0 - char bug?
4+ messages / 3 participants
[nested] [flat]

* Npgsql MS 2.0 - char bug?
@ 2006-06-11 11:32 Andy Shellam <andy@andycc.net>
  2006-06-11 12:15 ` Re: Npgsql MS 2.0 - char bug? Jim Buttafuoco <jim@contactbda.com>
  2006-06-28 19:05 ` Re: Npgsql MS 2.0 - char bug? Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
  0 siblings, 2 replies; 4+ messages in thread

From: Andy Shellam @ 2006-06-11 11:32 UTC (permalink / raw)
  To: pgsql-interfaces

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Npgsql MS 2.0 - char bug?
  2006-06-11 11:32 Npgsql MS 2.0 - char bug? Andy Shellam <andy@andycc.net>
@ 2006-06-11 12:15 ` Jim Buttafuoco <jim@contactbda.com>
  2006-06-11 13:44   ` Re: Npgsql MS 2.0 - char bug? Andy Shellam <andy@andycc.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Jim Buttafuoco @ 2006-06-11 12:15 UTC (permalink / raw)
  To: andy@andycc.net; pgsql-interfaces

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@andycc.net>
To: pgsql-interfaces@postgresql.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 -------




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Npgsql MS 2.0 - char bug?
  2006-06-11 11:32 Npgsql MS 2.0 - char bug? Andy Shellam <andy@andycc.net>
  2006-06-11 12:15 ` Re: Npgsql MS 2.0 - char bug? Jim Buttafuoco <jim@contactbda.com>
@ 2006-06-11 13:44   ` Andy Shellam <andy@andycc.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Andy Shellam @ 2006-06-11 13:44 UTC (permalink / raw)
  To: jim@contactbda.com; 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@andycc.net>
> To: pgsql-interfaces@postgresql.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!
> 
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Npgsql MS 2.0 - char bug?
  2006-06-11 11:32 Npgsql MS 2.0 - char bug? Andy Shellam <andy@andycc.net>
@ 2006-06-28 19:05 ` Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
  1 sibling, 0 replies; 4+ messages in thread

From: Francisco Figueiredo Jr. @ 2006-06-28 19:05 UTC (permalink / raw)
  To: pgsql-interfaces


--- Andy Shellam <andy@andycc.net> escreveu:

> Hi,
> 

Hi Andy.

Sorry for late response.... Yahoo mail filtered this mail as spam. :(


> 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;
> 


Do you have a simple test case, so I can run and check if there is a problem
with Npgsql?

Thanks in advance.




--
Regards,
Francisco Figueiredo Jr.
Npgsql Lead Developer - http://npgsql.projects.postgresql.org


"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


		
_______________________________________________________ 
Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. 
http://mail.yahoo.com.br/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-06-28 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-11 11:32 Npgsql MS 2.0 - char bug? Andy Shellam <andy@andycc.net>
2006-06-11 12:15 ` Jim Buttafuoco <jim@contactbda.com>
2006-06-11 13:44   ` Andy Shellam <andy@andycc.net>
2006-06-28 19:05 ` Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox