LWN.net Logo

Managing Many-to-Many Relationships with PL/pgSQL (O'ReillyNet)

David E. Wheeler looks at PL/pgSQL in this O'ReillyNet article. "A common pattern when managing the relationship between object-oriented applications and databases is the many-to-many relationship. Object-relational mappers usually manage these relationships as collections of objects, wherein one class has an accessor that returns a collection of related objects. For example, imagine that you're creating (yet another) blogging application. You want to associate your blog entries with tags. Tags can be used over and over again for different blog entries, and each blog entry can, of course, have more than one tag. In this scenario, the blog entry class might have a method that returns a collection of tag objects."
(Log in to post comments)

Managing Many-to-Many Relationships with PL/pgSQL (O'ReillyNet)

Posted Jun 30, 2006 22:07 UTC (Fri) by allesfresser (subscriber, #216) [Link]

Well, this seems to be quite timely, considering the patent-related news about RedHat this week...

Managing Many-to-Many Relationships with PL/pgSQL (O'ReillyNet)

Posted Jun 30, 2006 23:37 UTC (Fri) by smitty_one_each (subscriber, #28989) [Link]

Are there technical reasons to write in PL/pgSQL as opposed to any of the other tools that can be compiled into the server?
Having the non-joy of working in T-SQL at $job, I'd rather do something else when doing personal work on PostGreSQL.

Managing Many-to-Many Relationships with PL/pgSQL (O'ReillyNet)

Posted Jul 2, 2006 5:48 UTC (Sun) by flewellyn (subscriber, #5047) [Link]

PL/pgSQL has the advantage of being able to use all of the datatypes that PostreSQL understands
internally, without translation. This includes the "types" of specific tables, if you wish, as well as
any new types installed by other packages, such as PostGIS's geometry types. That, and it's
pretty easy to use, once you get the hang of the verbose syntax.

Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds