pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Record type in sql
2+ messages / 2 participants
[nested] [flat]

* Record type in sql
@ 2005-01-17 12:31 Din Adrian <adrian.din@easynet.ro>
  0 siblings, 0 replies; 2+ messages in thread

From: Din Adrian @ 2005-01-17 12:31 UTC (permalink / raw)
  To: pgsql-sql

Hello,
I have a little problem
I want to declare a type record for later use like that

create type record_structure1 as (id int2, nume text);
that is ok!

next in a function I want to use something like that:

select * from table as record_structure1 ?
instead of writing
select * from table as t1(id int2, nume text);
is this possible?

Thank You,
Adrian Din

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/



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

* Re: Record type in sql
@ 2005-01-17 12:48 KÖPFERL Robert <robert.koepferl@sonorys.at>
  0 siblings, 0 replies; 2+ messages in thread

From: KÖPFERL Robert @ 2005-01-17 12:48 UTC (permalink / raw)
  To: 'Din Adrian' <adrian.din@easynet.ro>; pgsql-sql

Yo can do s.t. similar, if the order in which you select the columns
corresponds to the order your type is defined.
So you'd gonna use: select intcol, textcol from table;

> -----Original Message-----
> From: Din Adrian [mailto:adrian.din@easynet.ro]
> Sent: Montag, 17. Jänner 2005 13:31
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Record type in sql 
> 
> 
> Hello,
> I have a little problem
> I want to declare a type record for later use like that
> 
> create type record_structure1 as (id int2, nume text);
> that is ok!
> 
> next in a function I want to use something like that:
> 
> select * from table as record_structure1 ?
> instead of writing
> select * from table as t1(id int2, nume text);
> is this possible?
> 
> Thank You,
> Adrian Din
> 
> -- 
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index 
> scan if your
>       joining column's datatypes do not match
> 



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


end of thread, other threads:[~2005-01-17 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-17 12:31 Record type in sql Din Adrian <adrian.din@easynet.ro>
2005-01-17 12:48 Re: Record type in sql KÖPFERL Robert <robert.koepferl@sonorys.at>

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