    I've ever ask my question (differently) in the other lists but no
response , so i think you are my last chance ....

I have the following table in my PostgreSQL Database :

create table one ( i int4 , j int4) ;

create table two ( o one , id int4 ) ;

insert into one values  (10, 20) ;

create function fct() returns one as '
select i as i , j as j from one ; '
language 'sql';

insert into two (select fct() , 1 ) ;

So when i do : select * from two

            o                                i d
136801144                        1

--------------------------------------------------
What is the first number ? I 've succeed with insert a new type ( one)
into my base ?
But i can't access to the information into o ?

Please , if you have any information about this problem , please contact
me

            loic@cri74.org


thanks


loic


Tue, 02 May 2000 14:31:51 +0200
=?iso-8859-1?Q?Lo=EFc=20TREGOU=CBT?= <loic@cri74.org>
insert new type (object ?)
Looc TREGOUKT wrote:
>     I've ever ask my question (differently) in the other lists but no
> response , so i think you are my last chance ....
>
> I have the following table in my PostgreSQL Database :
>
> create table one ( i int4 , j int4) ;
>
> create table two ( o one , id int4 ) ;
>
> insert into one values  (10, 20) ;
>
> create function fct() returns one as '
> select i as i , j as j from one ; '
> language 'sql';
>
> insert into two (select fct() , 1 ) ;
>
> So when i do : select * from two
>
>             o                                i d
> 136801144                        1
>
> --------------------------------------------------
> What is the first number ? I 've succeed with insert a new type ( one)
> into my base ?
> But i can't access to the information into o ?
>
> Please , if you have any information about this problem , please contact
> me

    IIRC  it  should  be the in memory address of the tuple table
    slot returnd by the function fct() at  the  INSERT  time.  At
    least, nothing useful.

    This  is  definitely  broken and for now you should stay away
    from functions returning tuples or SETs.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



Tue, 2 May 2000 16:11:45 +0200 (MEST)
JanWieck@t-online.de (Jan Wieck)
Re: insert new type (object ?)