if row has property X, find all rows that has property X

From: Дмитрий Голубь <dmitrii(dot)golub(at)me(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: if row has property X, find all rows that has property X
Date: 2014-06-24 13:32:14
Message-ID: 302594EA-F228-4D95-80A7-6F38690C7C58@me.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

For example I have table addresses and usually I want 2 things:
1. Find id of bad addresses.
2. Check if this address is good or bad.

For this I write two plpgsql functions
1. find_all_bad_addresses
2. is_bad_address(id)

These functions will duplicate logic of each other. How to not repeat myself?
Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2014-06-24 13:40:11 Re: if row has property X, find all rows that has property X
Previous Message John Lumby 2014-06-24 13:29:53 Re: Extended Prefetching using Asynchronous IO - proposal and patch