如何在PostgreSQL 10.6中删除uuid post?

时间:2019-07-04 10:02:45

标签: postgresql

我可以在应用程序中删除帖子,但不能在psql中删除帖子。

示例:

DELETE FROM post 
WHERE id = 9fe8e718-8853-4950-8c33-199e8194fde6;

返回语法错误!!!

/**
 * @var \Ramsey\Uuid\UuidInterface
 *
 * @ORM\Id()
 * @ORM\Column(type="uuid", unique=true)
 * @ORM\GeneratedValue(strategy="CUSTOM")
 * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
 */
private $id;

/*
 * Get id
 */
public function getId()
{
    return $this->id;
}

1 个答案:

答案 0 :(得分:2)

您需要将值括在单引号中

DELETE FROM post 
WHERE id = '9fe8e718-8853-4950-8c33-199e8194fde6';