RE: Object features of pg
От | Michael Ansley |
---|---|
Тема | RE: Object features of pg |
Дата | |
Msg-id | 7F124BC48D56D411812500D0B747251406144A@fileserver002.intecsystems.co.uk обсуждение исходный текст |
Ответ на | Object features of pg (Michael Ansley <Michael.Ansley@intec-telecom-systems.com>) |
Ответы |
RE: Object features of pg
RE: Object features of pg |
Список | pgsql-sql |
<p><font size="2">Hi, Peter,</font><p><font size="2">I suspected as much of the querying, but I can't even get data intothe tables. I tried this:</font><p><font size="2">insert into client values ('Michael');</font><br /><font size="2">insertinto address values ('11 Windsor Close, 'RH16 4QR');</font><br /><font size="2">INSERT 18935 1</font><br /><fontsize="2">update client set address = 18935 where name = 'Michael';</font><br /><font size="2">ERROR: Attribute 'address'is of type 'address' but expression is of type 'int4</font><br /><font size="2">'</font><br /><font size="2"> You will need to rewrite or cast the expression</font><p><font size="2">So that didn't work, and I triedcasting the oid, but that didn't seem to work either. Any ideas?</font><p><font size="2">Cheers...</font><br /><br/><p><font size="2">>> -----Original Message-----</font><br /><font size="2">>> From: Peter Mount [<ahref="mailto:peter@retep.org.uk">mailto:peter@retep.org.uk</a>]</font><br /><font size="2">>> Sent: 03 October2000 14:32</font><br /><font size="2">>> To: Michael Ansley</font><br /><font size="2">>> Cc: 'pgsql-sql@postgresql.org'</font><br/><font size="2">>> Subject: Re: [SQL] Object features of pg</font><br /><fontsize="2">>> </font><br /><font size="2">>> </font><br /><font size="2">>> On Tue, 3 Oct 2000,Michael Ansley wrote:</font><br /><font size="2">>> </font><br /><font size="2">>> > I've done thefollowing:</font><br /><font size="2">>> > </font><br /><font size="2">>> > create table address(address varchar(50), postcode varchar(9));</font><br /><font size="2">>> > create table client(id integer,name varchar(30), </font><br /><font size="2">>> address address);</font><br /><font size="2">>> > </font><br /><font size="2">>> > Now, how the hell do I get information into the address</font><br /><font size="2">>> field of client?</font><br /><font size="2">>> > There appears tobe very little in the manual dealing </font><br /><font size="2">>> with PGs object</font><br /><font size="2">>> > features. Any pointers to places in the manual, or </font><br /><font size="2">>> directinstructions</font><br /><font size="2">>> > would be gratefully accepted.</font><br /><font size="2">>> </font><br /><font size="2">>> Something like:</font><br /><font size="2">>> </font><br/><font size="2">>> select id,name,a.address,postcode</font><br /><font size="2">>> from clientc, address a</font><br /><font size="2">>> where c.address=a.oid;</font><br /><font size="2">>> </font><br/><font size="2">>> Probably neater ways of doing it...</font><br /><font size="2">>> </font><br/><font size="2">>> Peter</font><br /><font size="2">>> </font><br /><font size="2">>> -- </font><br /><font size="2">>> Peter T Mount peter@retep.org.uk <a href="http://www.retep.org.uk"target="_blank">http://www.retep.org.uk</a></font><br /><font size="2">>> PostgreSQLJDBC Driver <a href="http://www.retep.org.uk/postgres/" target="_blank">http://www.retep.org.uk/postgres/</a></font><br/><font size="2">>> Java PDF Generator <a href="http://www.retep.org.uk/pdf/"target="_blank">http://www.retep.org.uk/pdf/</a></font><br /><font size="2">>> </font><br /><font size="2">>> </font>
В списке pgsql-sql по дате отправления: