X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D641D9FA5C3 for ; Sun, 11 Jun 2006 10:44:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93370-09 for ; Sun, 11 Jun 2006 10:44:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sydney.mailnetwork.co.uk (server88-208-192-113.live-servers.net [88.208.192.113]) by postgresql.org (Postfix) with ESMTP id 0EA2F9F9CAA for ; Sun, 11 Jun 2006 10:44:42 -0300 (ADT) Received: from andyshellam-gw.adsl.newnet.co.uk ([80.175.198.137]:1487 helo=[192.168.1.5]) by sydney.mailnetwork.co.uk with esmtpa (Exim 4.60) (envelope-from ) id 1FpQF7-0006uq-FK; Sun, 11 Jun 2006 14:44:41 +0100 Message-ID: <448C1E47.5080503@andycc.net> Date: Sun, 11 Jun 2006 14:44:39 +0100 From: Andy Shellam Reply-To: andy@andycc.net Organization: AndyShellam.EU User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: jim@contactbda.com, pgsql-interfaces@postgresql.org Subject: Re: Npgsql MS 2.0 - char bug? References: <448BFF62.8030606@andycc.net> <20060611121415.M78056@contactbda.com> In-Reply-To: <20060611121415.M78056@contactbda.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/14 X-Sequence-Number: 6155 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 > 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! > >