Re: Structured Types, Oids and Reference Types - Mailing list pgsql-general
From | Craig Anslow |
---|---|
Subject | Re: Structured Types, Oids and Reference Types |
Date | |
Msg-id | 200210051254.47213.craig@mcs.vuw.ac.nz Whole thread Raw |
In response to | Re: Structured Types, Oids and Reference Types (Richard Huxton <dev@archonet.com>) |
List | pgsql-general |
Richard > Fair enough. Apologies if I made assumptions about your level of knowledge. That is fine I guess I didn't state my requirements clearly as this is the first time I have used any of the PostgreSQL lists. I have been using PostgreSQL for about 2 years. I also forgot to mention that I am emailing from New Zealand and that when you work I sleep and when I work you sleep, so that is one reason why I have probably not used the lists before, plus I have figured out most things that I needed to so far to do with relational features. > > Yes I agree but I specifically want to see if lists, arrays, setof or > > bagof exist in the PostgreSQL environment. > > The arrays you see are all there is. Their usage is somewhat limited at the > moment, afaik you can't check for the existence of a value anywhere within > an array, only check the nth value. That solves that problem then. > No lists, sets or bags I'm afraid. Most of the object-related stuff is the > older code iirc, there's not been too much development there. Maybe someone might implement these collection types one day. > > So going back to table oids. How can you tell what the oid of a table is > > and how can you refer to it? > > select oid from pg_class where relname = 'foo'; > > But I don't think it's going to help with what you want. I'll have to make some more tests and then I will let you know. > > > > 2) Can you dereference tuples or columns in a query by using a > > > > "deref" function (DEREF is a keyword) for '.' or C type syntax '->'. > > > > i.e > > > > > > You're not thinking in relational terms again. > > > > Yes I understand that. I specifically want to look at how to dereference > > an object using an object relational database. > > Nope - barring some feature I've not come across, you're not going to get > anywhere. I think you're looking for something that's just not in PG. I guess you are probably right because I have not seemed to be able to get it to work. However it is like the bug issue in programs, "you can't show that a program is bug-free, testing only shows the presence of bugs". > My understanding is that Postgresql's object features come from way back > when it was still being developed in academia (before the SQL parser even). > What you *can* do in PG is inherit one table (class) from another, to > extend person to cover lecturer and student for example. As part of one of masters projects I am looking at PostgreSQL's object relational features. Yeah I figured that inheritance issue out, that was straight forward. > You could also define your own types for setof etc. - I believe that's how > some of the specialised geographical stuff was introduced. Probably not > what you were looking to do I'm afraid. Yes you are right I just want to see if the collection types: list, bagof, setof and arrays are already implemented in PostgreSQL. > What I don't think you'll find is the sort of object-relational stuff to > tie java/c++ object persistance directly into Postgresql. I'm afraid I > don't know enough about such stuff to be able to point you to somewhere > else. Hopefully someone else on the list can. Okay we will see then. > I think this list is as good as any. Possibly the interfaces list might be > useful too, but the developers pop up on general pretty frequently. I might give interfaces list a go. > Again apologies for assumptions about your background. I read your message > thinking you were from a programming background and making your first > venture into RDBMS land. That is fine. Cheers Craig Email: craig@mcs.vuw.ac.nz Web: http://www.mcs.vuw.ac.nz/~craig
pgsql-general by date: