Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iyMFf-0000gm-Ob for pgsql-docs@arkaria.postgresql.org; Sun, 02 Feb 2020 20:53:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iyMFd-0002N8-F9 for pgsql-docs@arkaria.postgresql.org; Sun, 02 Feb 2020 20:53:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iyMFd-0002LI-4J for pgsql-docs@lists.postgresql.org; Sun, 02 Feb 2020 20:53:53 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iyMFa-0008JA-Cl for pgsql-docs@lists.postgresql.org; Sun, 02 Feb 2020 20:53:52 +0000 Received: by mail-wr1-x429.google.com with SMTP id z7so15324931wrl.13 for ; Sun, 02 Feb 2020 12:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=0F3dnruD9U2Qivv8Pg5znMlIYes+JhTy+hiSnFqUoJE=; b=IgKn1y7jeq6vvw0q9/Q1lgGODzaVQ9Ky6g7TmetxxfU0Q4H9IMFK1tLoqThZlhzxN6 Eq7fSB5ni58f/O/4LamFsJDnYsuCxVqtIan1QsddGFqwKWOGw7krfrUvY+nARIItsvC3 YfAHTBXmRx9fYI2Li0Mcf2JPDFmEVuWdr8nQ8zAS78yK41SvqhmzYA9k5yGlW+DxR/8+ bRuS9phZivouIgg1RCsWqjOg38uAbYuoqlS605imSJ8IDaQhflXAcsA2zrzhFVs+GAnY 9FeI1ZjPdlwICn478gHtvbOg05/qx4KmwTMlAvsHW6CioA5L7gkHkT95O2UEQRtZmlPv 8N/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=0F3dnruD9U2Qivv8Pg5znMlIYes+JhTy+hiSnFqUoJE=; b=M/B+qdjWBJMk+Pf9V/paYvViO/wiP2HsL5Ifh8fSU/aT/2eaDE3cYHBBAlZ07nSVA9 mzYXExsG5u65fqAjj/MMepj/+4WQ8V4HAfPp+RLwMkrChWeBNHfhQpjsUywanxDdM09h 4HG+D8eNLBXuaojklCEgQFHHUrZBuxNjfV1N0pu2SrdNMG7VyLyb1dbEWeQIFzg3PKBR ZpltX93ObGj2etjH6tXj3bPAHwi1YbWRSIGruPeGQIsxfk7Ru8c6mp0XiKfya7O7/dn4 6Bxz/VguZvNxA0doxpFBGZlingSfcVAYTFZcFlOI031vdfKlUE7LWp0ivCeiSTIqrsrb lwhg== X-Gm-Message-State: APjAAAVOP0sdYt5nd5g+j1zb0AICfa3GUN/uS/wmaxqiMUCEXKO+xqkd 5Lz/t8azIMC21mAqvj/o8rJxtw== X-Google-Smtp-Source: APXvYqxaM4ymJyYna/hqw9Gu4qPh8Ywpt8w5ZYK752c1uPQiZWe81378kseaBtmbA66SPVRboc34gg== X-Received: by 2002:a5d:5152:: with SMTP id u18mr11305426wrt.214.1580676828240; Sun, 02 Feb 2020 12:53:48 -0800 (PST) Received: from JW-Phone ([192.166.195.178]) by smtp.gmail.com with ESMTPSA id e1sm706440wrt.84.2020.02.02.12.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Feb 2020 12:53:48 -0800 (PST) Message-ID: <5a24b53cff1c4a723e21e4ef980d5bdcb74f33d1.camel@cybertec.at> Subject: Re: pg_dump, --exclude-table-data From: Laurenz Albe To: zvolsky@seznam.cz, pgsql-docs@lists.postgresql.org Date: Sun, 02 Feb 2020 21:53:46 +0100 In-Reply-To: <158054601828.19845.6369701897413049638@wrigleys.postgresql.org> References: <158054601828.19845.6369701897413049638@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, 2020-02-01 at 08:33 +0000, PG Doc comments form wrote: > I cannot find and understand what happens, if I will ommit the table data > for a table where primary keys are refenced by foreignkeys from other > tables. I think the integrity will break and such backup/dump is > unusable...? Or is there a way how to handle this during restore? > > (What I want to do is anonymize the content. I don't want to give user data > (User table), but lot of foreignkeys reference them. Something like > exporting all the rows with only primary key and foreign keys (which meet my > needs if just int/bigint are used for keys) + random content in other > fields. I understand that this is difficult to achieve and the completely > omiitted data will be ok - if there is not integrity problem during > restore.) Yes, if you omit the data for a table, restoring a foreign key that relies on the data will fail. Note that only the foreign key will fail and not get created, but the tables themselves will be restored. Yours, Laurenz Albe