CREATE OR REPLACE FUNCTION update_sellstatus()
RETURNS trigger AS
$body$
BEGIN
if products."sellStatus" = "Sold" then
update auctions
set "auctionStatus" = "End"
where (products."id" = auctions."idProduct");
end if;
END
$body$
language plpgsql
create trigger update_sellStatus_auctionStatus
after update on products
for each row
execute procedure update_sellstatus()
ERROR: missing FROM-clause entry for table "product"
I want to UPDATE column auctions.auctionStatus = "End" after UPDATE of column products.sellStatus = "Sold" where (products."id" = auctions."idProduct").
So I create a trigger but I got an error. It's make me can't UPDATE table products