Project

General

Profile

« Previous | Next » 

Revision 13605

fix: schemas/public_.sql: sync_*(): use util.copy() instead of CREATE TABLE AS so that table and column comments are also copied. this avoids the need to separately add the same comments to the view and its materialized table.

View differences:

trunk/schemas/public_.sql
2819 2819
    LANGUAGE sql
2820 2820
    AS $_$
2821 2821
SELECT util.recreate($$
2822
CREATE TABLE analytical_stem AS SELECT * FROM analytical_stem_view LIMIT 0;
2822
DROP TABLE IF EXISTS analytical_stem;
2823
SELECT util.copy('analytical_stem_view', 'analytical_stem');
2823 2824
ALTER TABLE analytical_stem ADD COLUMN taxon_occurrence__pkey serial PRIMARY KEY;
2824 2825

  
2825 2826
GRANT SELECT ON TABLE analytical_stem TO bien_read;
......
2844 2845
    LANGUAGE sql
2845 2846
    AS $$
2846 2847
DROP TABLE IF EXISTS geoscrub_input;
2847
CREATE TABLE geoscrub_input AS SELECT * FROM geoscrub_input_view LIMIT 0;
2848
SELECT util.copy('geoscrub_input_view', 'geoscrub_input');
2848 2849

  
2849 2850
GRANT SELECT ON TABLE geoscrub_input TO bien_read;
2850 2851
GRANT SELECT ON TABLE geoscrub_input_view TO bien_read;
......
2859 2860
    LANGUAGE sql
2860 2861
    AS $$
2861 2862
DROP TABLE IF EXISTS provider_count;
2862
CREATE TABLE provider_count AS SELECT * FROM provider_count_view LIMIT 0;
2863
SELECT util.copy('provider_count_view', 'provider_count');
2863 2864

  
2864 2865
GRANT SELECT ON TABLE provider_count TO bien_read;
2865 2866
GRANT SELECT ON TABLE provider_count TO public_;
......
2878 2879
    LANGUAGE sql
2879 2880
    AS $$
2880 2881
DROP TABLE IF EXISTS taxon_trait;
2881
CREATE TABLE taxon_trait AS SELECT * FROM taxon_trait_view LIMIT 0;
2882
SELECT util.copy('taxon_trait_view', 'taxon_trait');
2882 2883

  
2883 2884
GRANT SELECT ON TABLE taxon_trait TO bien_read;
2884 2885
GRANT SELECT ON TABLE taxon_trait_view TO bien_read;
trunk/schemas/vegbien.sql
2819 2819
    LANGUAGE sql
2820 2820
    AS $_$
2821 2821
SELECT util.recreate($$
2822
CREATE TABLE analytical_stem AS SELECT * FROM analytical_stem_view LIMIT 0;
2822
DROP TABLE IF EXISTS analytical_stem;
2823
SELECT util.copy('analytical_stem_view', 'analytical_stem');
2823 2824
ALTER TABLE analytical_stem ADD COLUMN taxon_occurrence__pkey serial PRIMARY KEY;
2824 2825

  
2825 2826
GRANT SELECT ON TABLE analytical_stem TO bien_read;
......
2844 2845
    LANGUAGE sql
2845 2846
    AS $$
2846 2847
DROP TABLE IF EXISTS geoscrub_input;
2847
CREATE TABLE geoscrub_input AS SELECT * FROM geoscrub_input_view LIMIT 0;
2848
SELECT util.copy('geoscrub_input_view', 'geoscrub_input');
2848 2849

  
2849 2850
GRANT SELECT ON TABLE geoscrub_input TO bien_read;
2850 2851
GRANT SELECT ON TABLE geoscrub_input_view TO bien_read;
......
2859 2860
    LANGUAGE sql
2860 2861
    AS $$
2861 2862
DROP TABLE IF EXISTS provider_count;
2862
CREATE TABLE provider_count AS SELECT * FROM provider_count_view LIMIT 0;
2863
SELECT util.copy('provider_count_view', 'provider_count');
2863 2864

  
2864 2865
GRANT SELECT ON TABLE provider_count TO bien_read;
2865 2866
GRANT SELECT ON TABLE provider_count TO public_;
......
2878 2879
    LANGUAGE sql
2879 2880
    AS $$
2880 2881
DROP TABLE IF EXISTS taxon_trait;
2881
CREATE TABLE taxon_trait AS SELECT * FROM taxon_trait_view LIMIT 0;
2882
SELECT util.copy('taxon_trait_view', 'taxon_trait');
2882 2883

  
2883 2884
GRANT SELECT ON TABLE taxon_trait TO bien_read;
2884 2885
GRANT SELECT ON TABLE taxon_trait_view TO bien_read;

Also available in: Unified diff