Search Postgresql Archives

Re: why it doesn't work? referential integrity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2007/8/11, Gregory Stark <stark@xxxxxxxxxxxxxxxx>:
>
> "Pavel Stehule" <pavel.stehule@xxxxxxxxx> writes:
>
> >   checked_by INT REFERENCES users (id) ON UPDATE CASCADE ON DELETE SET NULL,
>
> > CONTEXT:  SQL statement "UPDATE ONLY "public"."tasks" SET "worker" =
> > NULL WHERE $1 OPERATOR(pg_catalog.=) "worker""
>
> This says you mistyped the constraint above to refer to tasks(worker) instead
> of users(id). Did you?
>
> --

Im sorry. I don't understand.  It's look like wrong evaluation order:

1. delete from users
2. update tab set col = NULL

insead

1. update ... -- remove references
2. delete from users ...

Pavel Stehule



>   Gregory Stark
>   EnterpriseDB          http://www.enterprisedb.com
>
>

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux