pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
to_char()??
6+ messages / 4 participants
[nested] [flat]

* to_char()??
@ 2001-10-14 04:07 guard <guard@ficnet.net>
  2001-10-14 21:37 ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
  0 siblings, 1 reply; 6+ messages in thread

From: guard @ 2001-10-14 04:07 UTC (permalink / raw)
  To: pgsql-sql

dear sir

how to
select substr('hi there',3,5) as xx   -->>  xx change char type

thanks

--






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: to_char()??
  2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
@ 2001-10-14 21:37 ` Lee Harr <missive@frontiernet.net>
  2001-10-15 01:56   ` Re: to_char()?? guard <guard@ficnet.net>
  0 siblings, 1 reply; 6+ messages in thread

From: missive@frontiernet.net @ 2001-10-14 21:37 UTC (permalink / raw)
  To: pgsql-sql

> 
> how to
> select substr('hi there',3,5) as xx   -->>  xx change char type
> 

How about:

select substr('hi there', 3, 5)::varchar(5) as xx;

or is this not what you mean?




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: to_char()??
  2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
  2001-10-14 21:37 ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
@ 2001-10-15 01:56   ` guard <guard@ficnet.net>
  2001-10-15 14:05     ` Re: to_char()?? Szabo Zoltan <col@mportal.hu>
  2001-10-16 00:34     ` Re: to_char()?? Ross J. Reedstrom <reedstrm@rice.edu>
  2001-10-16 00:42     ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
  0 siblings, 3 replies; 6+ messages in thread

From: guard @ 2001-10-15 01:56 UTC (permalink / raw)
  To: pgsql-sql

thanks

I have run "select substr('hi there', 3, 5)::varchar(5) as xx;"
but get error message
Error: ERROR:  parser: parse error at or near ":"

--

"Lee Harr" <missive@frontiernet.net> ¼¶¼g©ó¶l¥ó·s»D
:9qd0j0$1gc3$1@news.tht.net...
> >
> > how to
> > select substr('hi there',3,5) as xx   -->>  xx change char type
> >
>
> How about:
>
> select substr('hi there', 3, 5)::varchar(5) as xx;
>
> or is this not what you mean?
>





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: to_char()??
  2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
  2001-10-14 21:37 ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
  2001-10-15 01:56   ` Re: to_char()?? guard <guard@ficnet.net>
@ 2001-10-15 14:05     ` Szabo Zoltan <col@mportal.hu>
  2 siblings, 0 replies; 6+ messages in thread

From: Szabo Zoltan @ 2001-10-15 14:05 UTC (permalink / raw)
  To: pgsql-sql

Try: ::text

CoL

guard wrote:

> thanks
> 
> I have run "select substr('hi there', 3, 5)::varchar(5) as xx;"
> but get error message
> Error: ERROR:  parser: parse error at or near ":"
> 
> --
> 
> "Lee Harr" <missive@frontiernet.net> ¼¶¼g©ó¶l¥ó·s»D
> :9qd0j0$1gc3$1@news.tht.net...
> 
>>>how to
>>>select substr('hi there',3,5) as xx   -->>  xx change char type
>>>
>>>
>>How about:
>>
>>select substr('hi there', 3, 5)::varchar(5) as xx;
>>
>>or is this not what you mean?
>>
>>
> 
> 




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: to_char()??
  2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
  2001-10-14 21:37 ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
  2001-10-15 01:56   ` Re: to_char()?? guard <guard@ficnet.net>
@ 2001-10-16 00:34     ` Ross J. Reedstrom <reedstrm@rice.edu>
  2 siblings, 0 replies; 6+ messages in thread

From: Ross J. Reedstrom @ 2001-10-16 00:34 UTC (permalink / raw)
  To: pgsql-sql

On Mon, Oct 15, 2001 at 09:56:26AM +0800, guard wrote:
> thanks
> 
> I have run "select substr('hi there', 3, 5)::varchar(5) as xx;"
> but get error message
> Error: ERROR:  parser: parse error at or near ":"

Upgrade your version of PostgreSQL:

test=# select substr('hi there', 3, 5)::varchar(5) as xx;
  xx   
-------
  ther
(1 row)

test=# select version();
                            version                            
---------------------------------------------------------------
 PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)

test=# 

Ross
-- 
Ross Reedstrom, Ph.D.                                 reedstrm@rice.edu
Executive Director                                  phone: 713-348-6166
Gulf Coast Consortium for Bioinformatics              fax: 713-348-6182
Rice University MS-39
Houston, TX 77005



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: to_char()??
  2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
  2001-10-14 21:37 ` Re: to_char()?? Lee Harr <missive@frontiernet.net>
  2001-10-15 01:56   ` Re: to_char()?? guard <guard@ficnet.net>
@ 2001-10-16 00:42     ` Lee Harr <missive@frontiernet.net>
  2 siblings, 0 replies; 6+ messages in thread

From: missive@frontiernet.net @ 2001-10-16 00:42 UTC (permalink / raw)
  To: pgsql-sql

On Mon, 15 Oct 2001 09:56:26 +0800, guard <guard@ficnet.net> wrote:
> thanks
> 
> I have run "select substr('hi there', 3, 5)::varchar(5) as xx;"
> but get error message
> Error: ERROR:  parser: parse error at or near ":"
> 

Works for me on 7.1.2 and pre-7.2
What version are you using?

select version();

That still leaves it unclear in my mind what exactly you want
from your query.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2001-10-16 00:42 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-14 04:07 to_char()?? guard <guard@ficnet.net>
2001-10-14 21:37 ` Lee Harr <missive@frontiernet.net>
2001-10-15 01:56   ` guard <guard@ficnet.net>
2001-10-15 14:05     ` Szabo Zoltan <col@mportal.hu>
2001-10-16 00:34     ` Ross J. Reedstrom <reedstrm@rice.edu>
2001-10-16 00:42     ` Lee Harr <missive@frontiernet.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox