2 ms·
> I'm personally a little annoyed at PG's efforts to turn SQL into half an OO programming language (see http://ledgersmbdev.blogspot.com/2012/08/postgresql-or-m
by porker 9y ago
> I'm personally a little annoyed at PG's efforts to turn SQL into half an OO programming language (see http://ledgersmbdev.blogspot.com/2012/08/postgresql-or-model.. http://ledgersmbdev.blogspot.com/2012/08/postgresql-or-model.... for examples)
I read that link and didn't get it - has anyone a fuller explanation or other links to recommend?
- aidos 9y agoI guess this is one of the more interesting examples to look at: select * from inventory_item i where (i.cogs_account).control_code = '5500'; You're only referencing 1 table in the query (inventory_item), but then i.cogs_account runs a query on a related table. It doesn't seem like a great idea to me. You can't really tell what's happening and there's a huge performance impact in doing it. The query planner is going to be a bit limited in what it can do. The example following where you have a save procedure against a column is a bit baffling. SELECT (i.save).* FROM (SELECT (row(null, 3, 1, 2, 'TEST124', 'Inventory testing item 2', 1, 2, true)::inventory_item).save) i;