From e86a9f160582073bdb2df73bcbee4e47a984059e Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Sat, 10 Aug 2013 06:15:14 +0000 Subject: [PATCH] #2419: agc_rules loading defaulting to is_custom true instead of false git-svn-id: http://svn.osgeo.org/postgis/trunk@11759 b70326c6-7e19-0410-871a-916f4a2858ee --- .../tiger_2011/pagc_normalize/pagc_tables.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql b/extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql index ec516325a..6e493f36c 100644 --- a/extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql +++ b/extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql @@ -40,7 +40,7 @@ language plpgsql; SELECT install_pagc_tables(); DELETE FROM pagc_gaz WHERE is_custom = false; DELETE FROM pagc_lex WHERE is_custom = false; -DELETE FROM pagc_rules WHERE is_custom = false; +DELETE FROM pagc_rules WHERE is_custom = false OR id < 10000; INSERT INTO pagc_gaz (id, seq, word, stdword, token, is_custom) VALUES (1, 1, 'AB', 'ALBERTA', 11, false); INSERT INTO pagc_gaz (id, seq, word, stdword, token, is_custom) VALUES (2, 2, 'AB', 'ALBERTA', 1, false); @@ -3822,7 +3822,7 @@ SELECT pg_catalog.setval('pagc_lex_id_seq', (SELECT greatest((SELECT MAX(id) FRO -- set default to false so all we input will be treated as no custom -- -ALTER TABLE tiger.pagc_lex ALTER COLUMN is_custom SET DEFAULT false; +ALTER TABLE tiger.pagc_rules ALTER COLUMN is_custom SET DEFAULT false; INSERT INTO pagc_rules (id, rule) VALUES (1, '1 -1 5 -1 2 7'); INSERT INTO pagc_rules (id, rule) VALUES (2, '1 3 -1 5 3 -1 2 7'); INSERT INTO pagc_rules (id, rule) VALUES (3, '1 22 -1 5 7 -1 2 7'); @@ -8177,6 +8177,8 @@ INSERT INTO pagc_rules (id, rule) VALUES (4351, '1 2 11 28 29 12 -1 10 10 11 13 INSERT INTO pagc_rules (id, rule) values (4352, '16 0 22 -1 16 17 17 -1 4 7'); INSERT INTO pagc_rules (id, rule) VALUES (4355, '-1'); +-- for some reason all rules are coming in as custom. just force by id +UPDATE tiger.pagc_rules SET is_custom = false where id < 10000; -- after insert we need to set back to true so all -- user inputs are treated as custom ALTER TABLE tiger.pagc_rules ALTER COLUMN is_custom SET DEFAULT true; -- 2.50.1