Re: [HACKERS] INSERT INTO ... SELECT problem

2000-12-05 Thread Alex Perel
On Tue, 5 Dec 2000, Tom Lane wrote: > Hmm. The rule will generate a query along these lines: > > DELETE FROM ips_free > FROM ips_free ipsfree2 > WHERE ips_free.block_id = ipsfree2.block_id > AND ips_free.ip = ipsfree2.ip > AND ipsfree2.ip = '10.10.10.10'; > > (I'm using ipsfr

Re: [HACKERS] INSERT INTO ... SELECT problem

2000-12-04 Thread Tom Lane
Alex Perel <[EMAIL PROTECTED]> writes: > CREATE RULE ip_allocated_rule AS > ON INSERT > TO ips_used > DO DELETE FROM ips_free > WHERE ips_free.block_id = NEW.block_id > AND ips_free.ip = NEW.ip; > INSERT INTO ips_used > (

[HACKERS] INSERT INTO ... SELECT problem

2000-12-04 Thread Alex Perel
Hi everyone, I've recently encountered a bizzare problem that manifests itself reliably on my running copy of postgres. I have a system set up to track IPs. The arrangement uses two mutually-exclusive buckets, one for free IPs and the other for used ones. There are rules set up on the used pool