Re: select * from (select * from bob) and other easy stuff
Posted in 2006
On Tue, 2006-09-26 at 11:55 -0700, internetuser wrote:
> Adam Tauno Williams wrote:
> > I don't know, this always made perfect sense to me. A "serial" data
> > type's serial-ness can't be preserved through a virtual table.
> But while a "serial" may be something interesting before the number is
> generated, once a value is actually generated and in the table, isn't
> it in fact just a number, sitting there, ripe for the picking?
No. Being serial does place restrictions on what the application is
free to do with it in regards to updating the record. This is why the
meta-data returned to the application when you do a select doesn't just
say INT, it will be a Serial8 or some such (depending on your
environment).
> For
> example - if I do something like:
> select myid,myid+50,
Sure but then myid+50 is an expression value, myid is still a serial.
> 1,51,I am not impressed,true,true,true
> 50,100,I am still not impressed,true,true,true
> The first column is a "serial", but what I see are just numbers.
Not it your looking at the metadata returned with the query - which all
smart applications do.
> It
> looks like an integer, it smells like an integer, I can add it to other
> integers and get a second column without casting it first.
Yep, which maybe shouldn't be the case. Looks like a concession to the
lazy and hapless to me. :)
> So why should I have to cast it when using MULTISET ? I don't get it.
> On a related note - what is REALLY stored in the serial column? Is it 1
> and 50, or is it some offset value from some base value, or whatever?