Re: [GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread Merlin Moncure
On Tue, Jun 24, 2014 at 8:40 AM, David G Johnston wrote: > Дмитрий Голубь wrote >> 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 >

Re: [GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread David G Johnston
Дмитрий Голубь wrote > 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

[GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread Дмитрий Голубь
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