Project

General

Profile

« Previous | Next » 

Revision 2232

schemas/vegbien.sql: Added _toPlacerank

View differences:

schemas/vegbien.my.sql
89 89

  
90 90

  
91 91
--
92
-- Name: _toPlacerank(); Type: FUNCTION; Schema: public; Owner: -
93
--
94

  
95

  
96

  
97

  
98
--
92 99
-- Name: _toTaxonrank(); Type: FUNCTION; Schema: public; Owner: -
93 100
--
94 101

  
......
138 145

  
139 146

  
140 147
--
148
-- Name: _toPlacerank; Type: TABLE; Schema: public; Owner: -; Tablespace: 
149
--
150

  
151
CREATE TABLE `_toPlacerank` (
152
    result text,
153
    value text
154
);
155

  
156

  
157
--
141 158
-- Name: _toTaxonrank; Type: TABLE; Schema: public; Owner: -; Tablespace: 
142 159
--
143 160

  
......
3682 3699

  
3683 3700

  
3684 3701
--
3702
-- Name: _toPlacerank_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3703
--
3704

  
3705

  
3706

  
3707

  
3708
--
3685 3709
-- Name: _toTaxonrank_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3686 3710
--
3687 3711

  
......
4809 4833

  
4810 4834

  
4811 4835
--
4836
-- Name: _toPlacerank; Type: TRIGGER; Schema: public; Owner: -
4837
--
4838

  
4839

  
4840

  
4841

  
4842
--
4812 4843
-- Name: _toTaxonrank; Type: TRIGGER; Schema: public; Owner: -
4813 4844
--
4814 4845

  
schemas/vegbien.sql
192 192

  
193 193

  
194 194
--
195
-- Name: _toPlacerank(); Type: FUNCTION; Schema: public; Owner: -
196
--
197

  
198
CREATE FUNCTION "_toPlacerank"() RETURNS trigger
199
    LANGUAGE plpgsql IMMUTABLE
200
    AS $$
201
BEGIN
202
    new.result := CAST(new.value AS placerank);
203
    RETURN new;
204
END;
205
$$;
206

  
207

  
208
--
195 209
-- Name: _toTaxonrank(); Type: FUNCTION; Schema: public; Owner: -
196 210
--
197 211

  
......
347 361

  
348 362

  
349 363
--
364
-- Name: _toPlacerank; Type: TABLE; Schema: public; Owner: -; Tablespace: 
365
--
366

  
367
CREATE TABLE "_toPlacerank" (
368
    result placerank,
369
    value text
370
);
371

  
372

  
373
--
350 374
-- Name: _toTaxonrank; Type: TABLE; Schema: public; Owner: -; Tablespace: 
351 375
--
352 376

  
......
4223 4247

  
4224 4248

  
4225 4249
--
4250
-- Name: _toPlacerank_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4251
--
4252

  
4253
CREATE UNIQUE INDEX "_toPlacerank_unique" ON "_toPlacerank" USING btree ((COALESCE(value, '\\N'::text)));
4254

  
4255

  
4256
--
4226 4257
-- Name: _toTaxonrank_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4227 4258
--
4228 4259

  
......
5350 5381

  
5351 5382

  
5352 5383
--
5384
-- Name: _toPlacerank; Type: TRIGGER; Schema: public; Owner: -
5385
--
5386

  
5387
CREATE TRIGGER "_toPlacerank" BEFORE INSERT OR UPDATE ON "_toPlacerank" FOR EACH ROW EXECUTE PROCEDURE "_toPlacerank"();
5388

  
5389

  
5390
--
5353 5391
-- Name: _toTaxonrank; Type: TRIGGER; Schema: public; Owner: -
5354 5392
--
5355 5393

  

Also available in: Unified diff