I managed to solve my problem with this information from another thread: http://old.nabble.com/postgresql-postgis-views-and-primary-keys-td28616028.html http://old.nabble.com/postgresql-postgis-views-and-primary-keys-td28616028.html
--------------------------------------------------------------------------- Hi, Metadata record must suit your your data source and in your case it is the view. Information needed: - schema of the view - name of the view - column in the view that should be used as primary key - in case of multi-column primary keys, index of first primary key part, and then again the column and index for the next part - pk_policy and pk_sequence are needed only with WFS-T so you can left them null Primary key columns will be eaten out from the output. If you need to get the information of the primary key columns into output you can select it twise into the view create view view_name as (select primary_key PK, primary_key to_be_published, second_column, ....) -Jukka Rahkonen- ------------------------------------------------------------------------ So what did I learn? 1. If you move from GeoServer 2.0.1 to 2.0.2, make sure all the namespaces are properly declared in the mapping-files. Looks like GeoServer 2.0.2 is stricter on this 2. If you use Feature Chaining & the chained feature is based upon a PostGIS-view: create table "gt_pk_metadata_table" and insert the view into it as described above Barbara Rahkonen Jukka wrote: > > Hi, > > These were the instructions for the first version but I suppose they work > still. We have not tried the system with PostGIS but it works with Oracle > for pointing the sequence to be used. > > > "To use the lookup functionality you'll have to create a lookup > table that GeoServer/GeoTools will use to determine the > primary key structure and the sequence. > You can create the table with: > > CREATE TABLE gt_pk_metadata_table ( > table_schema VARCHAR(32) NOT NULL, > table_name VARCHAR(32) NOT NULL, > pk_column VARCHAR(32) NOT NULL, > pk_column_idx INTEGER, > pk_policy VARCHAR(32), > pk_sequence VARCHAR(64), > unique (table_schema, table_name, pk_column), > check (pk_policy in ('sequence', 'assigned', 'autoincrement')) > ) > > where: > * table_schema (varchar): schema name > * table_name (varchar): table name > * pk_column (varchar): column name > * pk_column_idx (integer): column index if pk is multicolumn (nullable) > * pk_policy (varchar): pk assignment policy: "assigned", "sequence", > "autogenerated" > * pk_sequence (varchar): full name of the sequence to be used to > generate the next value, if any > > The table by default will be looked up in the current schema. > > If you want to name the table in a different way there is a datastore > parameter called "Primary key metadata table" where you can type a > different name. Also, if you need to put that table in a different > schema, you can specify a qualified name in the form or > schema.tableName > in that same field. > > If the metadata table above does not exist or does not contain > information about a specific table/view the usual set of heuristics > will be applied." > > -Jukka- > -- View this message in context: http://old.nabble.com/Error-duplicate-mappingName-in-2.0.2-%28but-works-fine-in-2.0.1%29-tp29570368p29621075.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users