On Tue, 12 May 1998, Bruce Momjian wrote:
> > prova=> select var as my_varchar from prova where var = '12';
> > my_varchar
> > ----------
> > 12 <--right justified
> > (1 row)
> >
> > prova=> select var as my_varchar from prova;
> > my_varchar
> > ----------
> > 12 <--left justified, this time ???
> > a12
> > a12
> > (3 rows)
> > Jose'
>
> I can't reproduce this here.
Seems that PostgreSQL justify data based on data not on data type.
My environment is:
PostgreSQL v6.3
Linux 2.0.33
also Daniel A. Gauthier <3in7ifi@cmich.edu>
reported the same problem.
here my script:
create table prova ( my_varchar varchar );
CREATE
insert into prova values ('12');
INSERT 528521 1
insert into prova values ('a12');
INSERT 528522 1
select * from prova where my_varchar = '12';
my_varchar
----------
12
(1 row)
select * from prova;
my_varchar
----------
12
a12
(2 rows)
EOF
Jose'