Re: cast - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: cast
Date
Msg-id Pine.BSF.4.21.0110221914500.48572-100000@megazone23.bigpanda.com
Whole thread Raw
In response to cast  (Esteban Gutierrez Abarzua <esgutier@sauce.chillan.ubiobio.cl>)
List pgsql-sql
On Mon, 22 Oct 2001, Esteban Gutierrez Abarzua wrote:

> 
> hi.
> 
> I wanna to make a query on this table(postgres system catalog):
> 
>  Attribute   |   Type    | Modifier 
> --------------+-----------+----------
>  relname      | name      | 
>  reltype      | oid       | 
>  relowner     | integer   | 
>  relam        | oid       | 
>  relpages     | integer   | 
>  reltuples    | integer   | 
>  .....
>  .....
>  ... 
> .
>   select relname from pg_class;
> 
>   How can I get a char or varchar cast for the name data type?....
>   because relname is a name data type and I want to get a char or varchar
> data type.  

In general, I think name and varchar(<identifier length>) are pretty
equivalent, but...

select CAST(relname as varchar) AS relname from pg_class;
should work.




pgsql-sql by date:

Previous
From: Reiner Dassing
Date:
Subject: Index of a table is not used (in any case)
Next
From: "Josh Berkus"
Date:
Subject: Re: Index of a table is not used (in any case)