[postgis-users] Help CONSTRAINTS and others questions

Rémi Cura remi.cura at gmail.com
Sun Dec 7 04:04:56 PST 2014


For the second part,
it depends hugely on how you edit the field.
Are you editing with psql, pgadmin, qgis, ...
Cheers,
Rémi-C

2014-12-07 10:39 GMT+01:00 Hugues François <hugues.francois at irstea.fr>:

> Hello,
>
>
>
> I’m not sure to understand well your problems but it seems you have sql
> questions rather than postgis ones… For the first one, I don’t really
> understand what you are looking for but I think what you want to add is
> constraint called foreign key (you will find useful information in the
> postgres documentation). For your second questions, you may achieve that
> using a trigger function but you have to be aware that it will not work if
> you have a not null or a primary key constraint (except if you have a
> serial type, a sequence, or any other rule in your trigger function to fill
> this column automatically)
>
>
>
> Hugues.
>
>
>
>
>
> *De :* postgis-users-bounces at lists.osgeo.org [mailto:
> postgis-users-bounces at lists.osgeo.org] *De la part de* Alessio Degioannini
> *Envoyé :* samedi 6 décembre 2014 13:32
> *À :* postgis-users
> *Objet :* [postgis-users] Help CONSTRAINTS and others questions
>
>
>
> 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".
>
> 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
>
>
>
>
>
>
>
> _______________________________________________
> 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/8549222c/attachment.html>


More information about the postgis-users mailing list