AW: [Mapbender-dev] PKs for all tables?

Uli Rothstein (WhereGroup) uli.rothstein at wheregroup.com
Wed Jan 31 05:43:11 EST 2007


Hi Marko,

Samson, Marko schrieb:
> Here are the first pks:
> 
> ALTER TABLE ONLY gui_layer
>     ADD CONSTRAINT pk_gui_layer PRIMARY KEY (fkey_gui_id,fkey_layer_id);
> 
> ALTER TABLE ONLY gui_wfs
>     ADD CONSTRAINT pk_gui_wfs PRIMARY KEY (fkey_gui_id,fkey_wfs_id);
> 
> ALTER TABLE ONLY gui_wms
>     ADD CONSTRAINT pk_gui_wms PRIMARY KEY (fkey_gui_id,fkey_wms_id);
> 
> ALTER TABLE ONLY layer_keyword
>     ADD CONSTRAINT pk_layer_keyword PRIMARY KEY (fkey_layer_id,fkey_keyword_id);
> 
> ALTER TABLE ONLY mb_user_wmc
>     ADD CONSTRAINT pk_user_wmc PRIMARY KEY (wmc_id);
> 
> ALTER TABLE ONLY wfs_element
>     ADD CONSTRAINT pk_wfs_element PRIMARY KEY (fkey_featuretype_id,element_id);
> 
> ALTER TABLE ONLY wms_format
>     ADD CONSTRAINT pk_wms_format PRIMARY KEY (fkey_wms_id,data_type,data_format);
> 
> ALTER TABLE ONLY wms_md_topic_category
>     ADD CONSTRAINT pk_md_topic_category PRIMARY KEY (fkey_wms_id,fkey_md_topic_category_id);
> 
> ALTER TABLE ONLY wms_srs
>     ADD CONSTRAINT pk_wms_srs PRIMARY KEY (fkey_wms_id,wms_srs);
> 
> There are some more tables without a pk....still working on it (some have many double and other weird entries(for example layer_epsg). that has to be cleaned first)....

Thanks a lot. There is a discription for a workaround for double entries in the 
talbe layer_epsg:

http://www.mapbender.org/index.php/Database_Changes_2.4.1

best regards
Uli


> Please have a look at it. But I think this should be alright so far.
> 
> 
> Gruß,
> Marko
> 
> 
> Marko Samson
> Landesbetrieb Wald und Holz NRW
> GIS-Anwendungsentwicklung
> Referat I-5
> Albrecht-Thaer-Straße 34
> 48147 Münster
> 
> 
> Achtung, neue Telefonnummer!
> Tel.: 0251/91797 - 169
> Mail: marko.samson at wald-und-holz.nrw.de
>  
> 
>> -----Ursprüngliche Nachricht-----
>> Von: mapbender_dev-bounces at lists.osgeo.org 
>> [mailto:mapbender_dev-bounces at lists.osgeo.org] Im Auftrag von 
>> Uli Rothstein (WhereGroup)
>> Gesendet: Mittwoch, 31. Januar 2007 08:23
>> An: Mapbender Developer List
>> Betreff: Re: [Mapbender-dev] PKs for all tables?
>>
>> Hi Marko,
>>
>> Samson, Marko schrieb:
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: mapbender_dev-bounces at lists.osgeo.org
>>>> [mailto:mapbender_dev-bounces at lists.osgeo.org] Im Auftrag von Uli 
>>>> Rothstein (WhereGroup)
>>>> Gesendet: Dienstag, 30. Januar 2007 10:11
>>>> An: Mapbender Developer List
>>>> Betreff: Re: [Mapbender-dev] Test of RC1 / some thoughts
>>>>
>>>> dear list-members,
>>>>
>>>> Marc Jansen schrieb:
>>>>> Hey Marko, hey List,
>>>>>>  
>>>>>> 2. Test of upgrading a 2.4 version
>>>>>>     - everything seems to work fine, too. (The first time
>>>> I did the
>>>>>> upgrade, I had all entries of gui_layers twice. Don't 
>> know, what I 
>>>>>> did wrong. Whatever, the second time everything worked
>>>> pretty nice. )
>>>>>>  
>>>>>> Idea:
>>>>>>  I saw, that you set "default_with_oids = true" in the new pgsql 
>>>>>> schema, but wouldn't there be a chance for grouped
>>>> primary-keys for
>>>>>> all the pk-less tables, for example the table gui_layer with a 
>>>>>> grouped-pk of fkey_gui_id and fkey_layer_id to prevent
>>>> double entries.
>>>>>> (same idea for all other tables without PK like
>>>>>> gui_layer,gui_wfs,gui_wms,...)
>>>>> I second that, if there are no other relevant issues. I 
>> can not see 
>>>>> any
>>>>> -- do you? A grouped PK should be the right way to handle
>>>> theses tables.
>>>>>>  Or is there a reason, why there are no PKs at some 
>> tables? In my 
>>>>>> opinion, there is no logic of having two entries, for 
>> example with 
>>>>>> the same fkey_gui_id and fkey_layer_id in table gui_layer.
>>>>>>
>>>>> Yipp, speaking from a database view of things, one does not
>>>> need two
>>>>> entries with the same values in the field you named. Am I missing 
>>>>> something?
>>>> I don't now. There may be some technical reasons to 
>> publish a layer 
>>>> twice, because nonexisting transparency of services for 
>> example. So 
>>>> you have more flexibility for the arrangement of layers. (But I've 
>>>> never seen such constructions in reality...)
>>> But this now can be managed very easy with the new 
>> treefolder to move the different layers up or down to handle 
>> that problem(additional to the wms_preferences modul). Or 
>> have I misunderstood what you meant?
>>
>> You're right. But we have some more GeoDataExplorer, for 
>> example the configurable one... Howerver, if we don't need to 
>> publish layer twice, we should have a unique fkey_wms_id - 
>> fkey_layer_id combination.
>>
>>> But there are several tables without pks. I think, for a 
>> stable datastructure it is advantageous to have pks at every table. 
>>
>> That's definitively true. Is someone able to list the missing 
>> pks and to create the corresponding sql-statements, if all 
>> dev-members agree?
>>
>> Thanks for your hints Marko and best regards Uli
>>
>>> _______________________________________________
>>> Mapbender_dev mailing list
>>> Mapbender_dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>
>> --
>> ---------------------------------
>>         Ulrich Rothstein
>>     WhereGroup GmbH & Co.KG
>>         Siemensstraße 8
>>          53121 Bonn
>>            GERMANY
>> ---------------------------------
>>     uli.rothstein at wheregroup.com
>>           uli at osgeo.org
>>         www.wheregroup.com
>>         www.mapbender.org
>> ---------------------------------
>> Zentrale:  ++49 (0) 228 909038 0
>> Durchwahl: ++49 (0) 228 909038 17
>> Fax:       ++49 (0) 228 909038 11
>> ---------------------------------
>>
>> ACHTUNG: Die Firmen Geo-Consortium, CCGIS und KARTA.GO haben 
>> ihre Fusion als WhereGroup zum 1.1.2007 bekannt gegeben.
>> Daher ändern sich ab Januar 2007 die Email Adressen und 
>> Telefonnummern.
>> _______________________________________________
>> Mapbender_dev mailing list
>> Mapbender_dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapbender_dev
>>
> _______________________________________________
> Mapbender_dev mailing list
> Mapbender_dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_dev


-- 
---------------------------------
        Ulrich Rothstein
    WhereGroup GmbH & Co.KG
        Siemensstraße 8
         53121 Bonn
           GERMANY
---------------------------------
    uli.rothstein at wheregroup.com
          uli at osgeo.org
        www.wheregroup.com
        www.mapbender.org
---------------------------------
Zentrale:  ++49 (0) 228 909038 0
Durchwahl: ++49 (0) 228 909038 17
Fax:       ++49 (0) 228 909038 11
---------------------------------

ACHTUNG: Die Firmen Geo-Consortium, CCGIS und KARTA.GO haben ihre Fusion als 
WhereGroup zum 1.1.2007 bekannt gegeben.
Daher ändern sich ab Januar 2007 die Email Adressen und Telefonnummern.


More information about the Mapbender_dev mailing list