[postgis-users] Help CONSTRAINTS and others questions

Alessio Degioannini a.degioannini at proterstudio.com
Sun Dec 7 05:23:46 PST 2014


> Maybe you already have some values in the code column of VTA which do 
> not exist in the code column of the survey table? You can not create a 
> constraint when existing data already violate the constraint.
No, the table VTA is totally empty.

Il 07/12/2014 13:54, Micha Silver ha scritto:
>
> On 12/06/2014 02:32 PM, Alessio Degioannini wrote:
>> Hi,
>> I'm a postgis/postgres newbie and I I would like to get some help on 
>> the topics that I'm going to describe.
>>
>> I have imported into the database the shapefile "survey" of points 
>> (trees). The spatial table "survey" contains five columns:
>> - "Gid" (created during import and primary key, integer)
>> - "Id"
>> - "Code"
>> - "Old number"
>> - "Geom" (it also created during import).
>>
>> The database includes several tables ("Species", "Defects", "Disease" 
>> and others) related to the main table "VTA".
>> Now I would like to know why, unlike what happened to the other 
>> tables, I can not connect with "ADD CONSTRAINT" column "code" 
>> (integer, not null, unique) of the table "VTA" to the corresponding 
>> column "code" (also integer, not null) the spatial table "survey".
>>
>
> Maybe you already have some values in the code column of VTA which do 
> not exist in the code column of the survey table? You can not create a 
> constraint when existing data already violate the constraint.
>
>> Another question: when I'm editing a field (for example "species 
>> name" in the column "species" of table "VTA", related to the table 
>> "Species", would that "species name" could be completed on the basis 
>> of the records in the table "Species". How can I do this?
>> Thanks in advance.
>>
>> Alessio
>>
>>
>>
>>
>>
>> This mail was received via Mail-SeCure System.
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>> This mail was received via Mail-SeCure System.
>>
>>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20141207/9b48b7aa/attachment.html>


More information about the postgis-users mailing list