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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to