[Pdns-users] Duplicate records in Postgresql records tables

Peter van Dijk peter.van.dijk at netherlabs.nl
Wed Jun 6 09:16:47 UTC 2012


Hello Steven,

On Jun 4, 2012, at 23:36 , Steven Truong wrote:

> I am new to powerdns and just setup one with Postgresql backend.  The
> problem is that I could insert duplicate records into records table.
> Looking at the schema of records table, only the 'id' is the primary
> key while 'name' is not being restricted in such a way to allow users
> to only create unique records.
> 
> I am using the default schema that comes with Ubuntu 12.04.
> 
> Please share your thoughts and approaches to allow creating unique
> records for domains.


Within an RRset (defined as 'the set of records that share name and type'), TTLs must be equal and content must be unique. Our default SQL schemas do not enforce these requirements (but PowerDNS will deduplicate content when serving it, as far as I know).

Adding a unique constraint over (name,domain_id,type,content) should not pose any problems.

Kind regards,
-- 
Peter van Dijk
Netherlabs Computer Consulting BV - http://www.netherlabs.nl/




More information about the Pdns-users mailing list