Re: select statement fails

From: Richard Huxton <dev(at)archonet(dot)com>
To: Andrus Moor <eetasoft(at)online(dot)ee>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: select statement fails
Date: 2008-04-09 10:03:53
Message-ID: 47FC9489.50204@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrus Moor wrote:
> Richard,
>
>> It doesn't return rows because you're using a space-padded type (char)
>> to try and store a space.
>>
>> I think you probably want varchar(1) instead.
>
> thank you.
> I have production database whose schema cannot changed easily.

ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It
will require a lock on the table though.

> I is more reasonable to force npgsql driver to generate other code if no
> other solution.
> npgsql driver wants to add explicit casts to parameters.
> Is it reasonable to force driver to generate code
>
> select * from test where tc=' '::char(1);
>
> for char parameter type ?

I'd say so - I presume it just needs to be taught about different types
of text. Presumably it already knows that int8 is different from int4,
so it'll be doing something similar already. Check if there is a
mailing-list for the npgsql project and ask there - someone might
already be working on it.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2008-04-09 10:15:52 Debugging Pl/PgSQL functions with the debug contrib module
Previous Message Ashish Sharma 2008-04-09 09:43:16 SQL fast in PSQL, very slow using MS.NET driver