Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-17 Thread Nicolas Ribot
Hi, If data contain both LINESTRING and MULTILINESTRING, then you should use the MULTILINESTRING constraint. (this is the default shp2pgsql behavior, as you noted). Concerning the trigger, this is a 2 step operation: First you create the function the trigger will call Then you create a trigger on

Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Gery
Thanks a lot Hugues and Nicolas for your suggestions, it worked like a champ. About why I'm actually using both linestrings and multistrings is because the shape I'm importing contains the latter. I tried to import it with shp2pgsql -S but it gives: "We have a Multilinestring with 2 parts, can't us

Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Nicolas Ribot
(sorry Hugues, did not see your answer... 0_o) On 15 December 2012 17:23, Nicolas Ribot wrote: > Hi, > > By calling AddGeometryColumn('public', profiles_line_wgs84', 'geom', > 4326, 'LINESTRING', 2), Postgis 2.0 created a geometry column of type > geometry(LineString,4326) > that restrict tha

Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Nicolas Ribot
Hi, By calling AddGeometryColumn('public', profiles_line_wgs84', 'geom', 4326, 'LINESTRING', 2), Postgis 2.0 created a geometry column of type geometry(LineString,4326) that restrict that column to LINESTRINGs only. The constraint defined later does not change this restriction. To enable the olde

Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Francois Hugues
Hello, Sorry for previous message : finger error. To give you some answers to your question : 1. In post gis 2 you may use typemod instead of constraints. This change the behavior of addgeometrycolumn function. You may read the notes here : http://postgis.refractions.net/docs/AddGeometryColumn.

Re: [postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Francois Hugues
Hello, "Gery ." a écrit : Hello, I recently upgraded both my postgresql (from 8.4.4 to 9.2.2) and postgis (from 1.5.3 to 2.0.2 r10789). With the previous versions I run these commands without problems: [code] CREATE TABLE profiles_line_wgs84( GID SERIAL, ID SMALLINT, FID SMALLINT, SURVEY

[postgis-users] constraint issue in 2.0.2 r10789

2012-12-15 Thread Gery .
Hello, I recently upgraded both my postgresql (from 8.4.4 to 9.2.2) and postgis (from 1.5.3 to 2.0.2 r10789). With the previous versions I run these commands without problems: [code] CREATE TABLE profiles_line_wgs84( GID SERIAL, ID SMALLINT, FID SMALLINT, SURVEY VARCHAR(100), PROFILE VARCHAR(1