"Andrus" <[EMAIL PROTECTED]> writes:
> 1. SQL assumes that CHARACTER(n) column is always padded with spaces in
> right.
> So casting to text should preserve spaces.
No, it should not. In CHAR(n), trailing spaces are semantically
insignificant; 'foo' and 'foo ' are considered equal. In TEXT
they
On Apr 10, 2008, at 3:13 AM, Andrus wrote:
Albe,
select * from test where tc=' '::text;
Because the arguments to the operator "=" are of different type,
implicit type conversion takes place.
"character(1)" will by converted to "text", during this conversion
trailing blanks will be ignored, as
On Thu, Apr 10, 2008 at 11:13:33AM +0300, Andrus wrote:
> 1. SQL assumes that CHARACTER(n) column is always padded with spaces in
> right.
> So casting to text should preserve spaces.
> Why PostgreSQL cast to text violates SQL ?
It says it is padded with spaces, but it also says that these spaces
Albe,
>> select * from test where tc=' '::text;
>Because the arguments to the operator "=" are of different type,
>implicit type conversion takes place.
>"character(1)" will by converted to "text", during this conversion
>trailing blanks will be ignored, as befits the "character(n)" type.
Thank y
On Wed, Apr 9, 2008 at 1:31 PM, Francisco Figueiredo Jr.
<[EMAIL PROTECTED]> wrote:
> > >
> > >
> >
> > Ask the .npgsql mailing lists. They'll be able to tell you. There must be
> a
> > way of handling "non-standard" types in any case.
> >
>
> Hi all!
>
> We are already working on that. Th
> >
> >
>
> Ask the .npgsql mailing lists. They'll be able to tell you. There must be a
> way of handling "non-standard" types in any case.
>
Hi all!
We are already working on that. The cast problem is indeed a bug in
Npgsql. We already have a one line fix for it.
Check it out here:
http://pgf
Andrus wrote:
ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It will
require a lock on the table though.
1. This is part of composite primary key. It is discriminator column and
cannot contain empty string, only single char is allowed.
char(1) doesn't enforce that. It enf
> ALTER TABLE...ALTER COLUMN...TYPE will do it within one statement. It will
> require a lock on the table though.
1. This is part of composite primary key. It is discriminator column and
cannot contain empty string, only single char is allowed.
2. I'm afraid that this will broke existing applic
Andrus wrote:
> Any idea why the following select statement does not return rows ?
> This select statement is generated by npgsql2 beta 3 so I
> cannot change it in my application.
> How to fix without changing select statement ?
>
> Andrus.
>
> create temp table test ( tc char(1) );
> insert int
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
Andrus wrote:
Any idea why the following select statement does not return rows ?
This select statement is generated by npgsql2 beta 3 so I cannot change it
in my application.
How to fix without changing select statement ?
Andrus.
create temp table test ( tc char(1) );
insert into test values(
Any idea why the following select statement does not return rows ?
This select statement is generated by npgsql2 beta 3 so I cannot change it
in my application.
How to fix without changing select statement ?
Andrus.
create temp table test ( tc char(1) );
insert into test values(' ');
select * fr
12 matches
Mail list logo