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 1he5VF-0006js-CH for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 22:25:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1he5VD-0006m1-22 for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 22:25:55 +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 1he5VC-0006iq-Oj for pgsql-general@lists.postgresql.org; Thu, 20 Jun 2019 22:25:54 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1he5V7-0006iq-Tg for pgsql-general@postgresql.org; Thu, 20 Jun 2019 22:25:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0407921FC1; Thu, 20 Jun 2019 18:25:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 20 Jun 2019 18:25:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=Q GnWMv5JLd5uRFWFqv068ellARulXsTnIwaUiL8qyJU=; b=sOfTLZnUQC2p1WIpM f+9Cay6WlAJVUNLe9LGgl2B7uNS7/WASuzo9UujLHBB4BlGUFrDpNZSAkE2JDzb6 pD5cmEwTmRhMLyeUPVETiRVa8fPQFDdHYOq0etsgwnqnGtGVoXkXVsBgLDXW1RRs /m8UI5oXfb6OF2iXO4rS2kuaiJo1bm4u7VeK3rmXbA4fMsgcuDY6y59otwkLF0Ni aGxH6DAiD1BpurcpH/O9XNm03xrpnhc0NiKt8huPIgzTfOZx5WVmzRIBMxOYSrLV 5uLoPgh3SciNqAALgv7xS3GXvYJwLeMNTMt/OjSNuSfYUbxSAoe+floSwNqXS4EC VPILQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=QGnWMv5JLd5uRFWFqv068ellARulXsTnIwaUiL8qy JU=; b=KdrbRUvZNu7025T3OVZdvQmD1H80g41C4iGywzE0hScPW6O8DsX2uP6e+ mLObtqEUJTs+k3FirZ/+fnkWb9mGenLs9vLy6koag1hjkB20S28L7n9TIRMJpJ2l et4nRcH350u9tnuOPthLPFkppdmnh2VPPmjPudQOtxXIJPUWl4E726UyMOtpQ/k2 vhC7h2NeCzsAXRSaIDsG0cdQs2A5Fen4bfLC53VYDCk7+7Rmh9r0pWw4zHyTgLOG +aEu/+efq9Jfp7Ppw62RPUMyMXUK3MRQeZqfSkwa+zjjXsYY+KvVBY3Gr969jhdR TOOMXqq99YZGluVjDpcROtSYOo88A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdehgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhgrggumhhinhdroh hrghdpshhqlhdqfihorhhksggvnhgthhdrvghunecukfhppeejgedrleegrdejfedrvddv vdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklh grvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 3EE76380074; Thu, 20 Jun 2019 18:25:46 -0400 (EDT) Subject: Re: Need create table statements from metadata To: David Gauthier , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: <2c3e0a27-7f27-33fa-c580-cca381aca77c@aklaver.com> Date: Thu, 20 Jun 2019 15:25:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/20/19 2:32 PM, David Gauthier wrote: > psql (9.6.7, server 9.5.2) on linux. > > I have 2 DBs, one for dev the other is live.  I want to recreate several > tables in the dev db using the same metadata found in the live db.  But > I'm too lazy to manually transcribe everything and that's prone to error > anyway. > > In the past, I would just run pg_dump and capture metadata only for > selected tables, then use that to (re)create that tables in the other > DB.  But where I am now, they don't give me the privs to run pg_dump. > > So I was wondering if there's a way to do this quickly and cleanly > without pg_dump.  Perhaps a stored procedure that pg_dump uses (or > something like that) ? To add to my previous post you can use third party tools: 1) SQL Workbench/J http://www.sql-workbench.eu/ http://www.sql-workbench.eu/TableSource_png.html 2) pgAdmin https://www.pgadmin.org/ https://www.pgadmin.org/docs/pgadmin4/4.x/table_dialog.html > > Thanks in Advance ! -- Adrian Klaver adrian.klaver@aklaver.com