Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aczOZ-0005Xj-D7 for pgsql-admin@arkaria.postgresql.org; Mon, 07 Mar 2016 17:56:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aczOY-0003Qf-VJ for pgsql-admin@arkaria.postgresql.org; Mon, 07 Mar 2016 17:56:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aczOY-0003QY-Bk for pgsql-admin@postgresql.org; Mon, 07 Mar 2016 17:56:38 +0000 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aczOV-0000fT-42 for pgsql-admin@postgresql.org; Mon, 07 Mar 2016 17:56:36 +0000 Received: by mail-oi0-x233.google.com with SMTP id d205so84898830oia.0 for ; Mon, 07 Mar 2016 09:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=8TcZZSJmR8Y40mPgYYBqpVWPqab9p5rABF9CcdgxEXI=; b=GTFjqBsGz/uZMSm7z69NP5kFkfDGmP1bwSCnaDfnA86WUk06PfHyFt6MxZvYZpEB8O 7tMqlo61A+/yCHxLIxJvC/Y71RbM6hNAyUKzY1h2SLz4/yDEUgcIBok4pNnrEzrzgx4c eY7tsWuPDsEVYRCM0OXagQUmDJ+Oae7SUuw6f2AV0pvjDOiLp/8mvGo6qEMSI6VJzHhH TuvtWmsQBcBJUgeLaotazobd2V4ExW1YQRaW4jbN0O3f1WrgF6yEUQE/8yF1s+oYwOic HyASs/R7DFSAXDn89YCqabz0dhqX73FUomuxX0tuirVFgj0+yPiIXeB5urSDqVZhuQup ilHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=8TcZZSJmR8Y40mPgYYBqpVWPqab9p5rABF9CcdgxEXI=; b=ORgwQocjWnLfyU1W69zGvB6CIYgMC4hwbCO5/Mhi/QMHj8RYhBmw26eXFs9CY4vQdd 6Xi5A5hWF3NjKD5/bY0/D9zhtyVE5k8sYSZCxd8XnHiXGSCG3IXx7nBMfYBGtLDclBVk ZprUHssd9EioAziSv3zwI1T1t2+EUvrGXsFrwHFaFXCbbTVh+rC8dL42ZexQ5sU3oKjd mI26nQ2oUYD5yalDFKwYFVrOzWfeI5ApvHfXxa9qR+5VA79cWFDhzvYa20F8BKiRo+b/ YG483o6gy2QuntxIDG0lIRSpX9SDxQNuLvINUgRFtwHAhZjk1BpOi1GRB9zmdMZcW5Qa oJVQ== X-Gm-Message-State: AD7BkJIxSNOR/BF38Uvcruyq4O2Qvpd5K2TWAxlMDqmyxuJwCQEY+camC6T5Ht8AKCi4ww== X-Received: by 10.202.184.136 with SMTP id i130mr12716667oif.99.1457373393870; Mon, 07 Mar 2016 09:56:33 -0800 (PST) Received: from ?IPv6:2602:306:37d8:1e20:a118:e186:74f3:4653? ([2602:306:37d8:1e20:a118:e186:74f3:4653]) by smtp.gmail.com with ESMTPSA id n5sm10351416obi.20.2016.03.07.09.56.31 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2016 09:56:32 -0800 (PST) From: "Armand Pirvu (home)" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: pg_dump and pg_restore relative to the schema Message-Id: <98DA8456-9D6D-47B0-BEC7-5D3C426C6F72@gmail.com> Date: Mon, 7 Mar 2016 11:55:59 -0600 To: pgsql-admin@postgresql.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi I have a table in a db called csi_logs and it resides in it;s own schema ca= lled csilog I need to move it to a totally different database but with a different sche= ma called csidev 1 - I took the table ddl /usr/pgsql-9.5/bin/pg_dump --username pgdba --format plain --file /var/lib= /pgsql/armandp/csireg.csilogs --schema-only -d csireg --table=3Dcsi_logs 2 - Replaced csilog with csidev in csireg.csilogs 3 - In the new db , which has the schema csidev, I created the table using = the DDL from (2) 4 - pg_restore fails -bash-4.2$ /usr/pgsql-9.5/bin/pg_restore --username=3Dpgdba --format=3Dc /v= ar/lib/pgsql/armandp/csireg.csilogs.data --data-only --dbname=3Dcsilog --t= able=3Dcsi_logs pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 3553; 0 29955 TABLE DATA c= si_logs pgdba pg_restore: [archiver (db)] could not execute query: ERROR: relation "csi_= logs" does not exist Command was: COPY csi_logs (log_id, log_time, log_server_name, severity= _level, log_message, json_data, stack_trace) FROM stdin; Bu the table is there . So is the schema also embedded in the data file ? = I am going plain format now to see but if that would be the case, why embed= the schema in a data only file ?=20 Any other gotchas ? Thank you Armand --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin