Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooPbH-00057F-CV for pgsql-admin@arkaria.postgresql.org; Fri, 28 Oct 2022 13:40:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ooPbG-0002hT-9F for pgsql-admin@arkaria.postgresql.org; Fri, 28 Oct 2022 13:40:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooPbF-0002fW-U9 for pgsql-admin@lists.postgresql.org; Fri, 28 Oct 2022 13:40:41 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ooPbD-0006B3-Gw for pgsql-admin@lists.postgresql.org; Fri, 28 Oct 2022 13:40:41 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-13c569e5ff5so5914282fac.6 for ; Fri, 28 Oct 2022 06:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=L8XfqZX9nEpkee2VHAf/16gFfdC4So0+d7vmiSQXF/Q=; b=QHqlUyWzfX+gU2diyYOaMAjIJ/JlZBgKWph2rN0kBweIwArQW7hK1w5eYJ5P2zohRp GEybif/CugO0kQ1YRaCyV7r82mWdc+oeOnggrVu4OgvBeioXGJS8xZZVodA2Nr43qgEL sxTTslGY4hYmguY+StaOQD+xmqbYOBr00NrVvLgw/xgM7rZJe/9G+hTQLy8LnMVBo+d6 WFRefwwxrjaVvsCGTYEGTIq7gm6NqI25xwGoQgkDtR/hU+YeHRyjAAG5hC+cg71SITPE fDX9oTwNt44XYAqs3UhWsuOXKPFEuWl2Ec9xHkntAaWMiXic7YyeJ6j1bLbZGPWYKZzm dqnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L8XfqZX9nEpkee2VHAf/16gFfdC4So0+d7vmiSQXF/Q=; b=HJC8TuLJYFNvFWPsNxXx9oPQ1Em2zHuCTCOThuTjAVKEJ8/F9f2YD/uZoSxO1dI3pv BiRo8HQXHngL226v7qv9E0X0nvE6VJpJD0UvUMn3wfsp4lU58ny4CfzzZtTjzpTWxURM Wk339icLRlVgGSaciMW2dJljcXTjIbn7R6uDFsZe+/0XPyxHqJLt7b8FZKILPSH6dqB0 vb5bc1U97Ylr4ExXB9VzKS8373n6amgVjS4y32ogSNLSyOIUzHRy15YuNWWF1MGR8B1E CQ7AmftF3I8eFq5xbRbnM7tWGdKR9xOFjqP2R98TG5dVU1kYFwWEQ5jio7VvFnjikJPe VNGQ== X-Gm-Message-State: ACrzQf3Rax90gw8LFqo2gFr6udR1lgjaQERBIL0gCqTZjah7LZROEGAN 1y6GXFbWfR9NxsvfrwVqEvR9Ryih+HQ= X-Google-Smtp-Source: AMsMyM7FIzY4dF7GtmBm+Pn15YFnkfmut29uyN2pbyqD5uvJmLJA0+dASGCsLo50nqmFlfHWR9oZsw== X-Received: by 2002:a05:6870:5803:b0:12c:c3e0:99dc with SMTP id r3-20020a056870580300b0012cc3e099dcmr8402650oap.19.1666964437455; Fri, 28 Oct 2022 06:40:37 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id c13-20020a9d784d000000b00668953207b2sm1661583otm.80.2022.10.28.06.40.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 06:40:36 -0700 (PDT) Message-ID: <747bdd32-a2ed-2aad-9204-53b03bd8d58f@gmail.com> Date: Fri, 28 Oct 2022 08:40:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: create tables using the application metadata Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: From: Ron In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/28/22 02:43, Nikhil Ingale wrote: > Hi All, > I've metadata tables of our application where we have all tables,columns > and constraints information about each table stored. > > How do I generate the CREATE TABLE sql scripts to generate schema using > our application metadata table? Depending on how your metadata tables are organized, use either the format() function embedded in a SELECT statement, or have your application generate dynamic SQL. -- Angular momentum makes the world go 'round.