Re: [PG9.1] CTE usage

Поиск
Список
Период
Сортировка
Искать
От
Adrian Klaver
Тема
Re: [PG9.1] CTE usage
Дата
Msg-id
52370CB6.8020001@gmail.com
Ответ на
Re: [PG9.1] CTE usage (Ladislav Lenart)
Список
Дерево обсуждения
[PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
Re: [PG9.1] CTE usage David Johnston <polobo@yahoo.com>
Re: [PG9.1] CTE usage Vincent Veyron <vv.lists@wanadoo.fr>
Re: [PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
Re: [PG9.1] CTE usage Alban Hertroys <haramrae@gmail.com>
Re: [PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
Re: [PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
Re: [PG9.1] CTE usage Adrian Klaver <adrian.klaver@gmail.com>
Re: [PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
Re: [PG9.1] CTE usage Adrian Klaver <adrian.klaver@gmail.com>
Re: [PG9.1] CTE usage Ladislav Lenart <lenartlad@volny.cz>
On 09/16/2013 04:57 AM, Ladislav Lenart wrote:
> On 16.9.2013 13:26, Alban Hertroys wrote:

>>
>> Wouldn't it be much easier to define an FK constraint with ON DELETE CASCADE?
>> With that, you only need to worry about which rows you delete from the
>> parent table and dependant children will be removed automatically.
>
>
> Hello.
>
> I don't quite follow. Having item.item_type1_id FK with ON DELETE CASCADE would
> delete ITEM (the parent) when ITEM_TYPE1 (the child) is deleted. You suggests
> the opposite direction.

http://www.postgresql.org/docs/9.3/interactive/sql-createtable.html

"..In addition, when the data in the referenced columns is changed, 
certain actions are performed on the data in this table's columns. The 
ON DELETE clause specifies the action to perform when a referenced row 
in the referenced table is being deleted. .."

"..CASCADE
Delete any rows referencing the deleted row, or update the values of the 
referencing column(s) to the new values of the referenced columns, 
respectively.
.."




-- 
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления
От: Ladislav Lenart
Дата:
Сообщение: Re: [PG9.1] CTE usage
От: Ladislav Lenart
Дата:
Сообщение: Re: [PG9.1] CTE usage
FAQ