Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1trhz9-007o6s-0Z for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 18:36:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1trhq5-00Gflc-46 for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 18:26:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1trhq4-00GflO-98 for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 18:26:56 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1trhq0-0025Mt-0k for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 18:26:55 +0000 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 3688C11401C0; Mon, 10 Mar 2025 14:26:52 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 10 Mar 2025 14:26:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1741631212; x=1741717612; bh=0Rdi24ocRhNNTwRr0AccTnBGANCZo0feT/kdnC9YnPc=; b= otisjo3CyVxbVDBKo7tMLQCisq6+7GAZgcAE4Upij6D1iMh8mKoMLFWMBeuioiSD dkAAWgomP/hC6SOnxR2Y7cg3B7xdULpIJhBMBX9YmSfCo+bvMjc1x8os76NFUqB/ +47U2niYHmPbIksRS3JztXJcr1UH/WXQ1HDOw4aSYmGxPPx7/QWRG3r+sDsry/Ze lnLVP06OXK5IE4cVmZg8uCi20LjZ5jvPahFKNZkkowGqF8BKcEZV3bVPicdPzOWp fA/gbhYZnKCsvHHBoAWLfE4JXC4T+hM6dx0QY1viMp/ZP/SPD3TPsyFbRdyHyahe +ZfMexK2MrSQ3pSjnMtqdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741631212; x=1741717612; bh=0 Rdi24ocRhNNTwRr0AccTnBGANCZo0feT/kdnC9YnPc=; b=UhfzJ8GaJNVMEPYDm Fl4RzRGcRUfkwqHq6ZS1SysFQ1jJhD8PdjxYab8IEBfTY1VP86YUf+kBINJBFXMV 6DcbaNnLIefyswnCkYqnaT2yLxXhyItPiTsbNqBq37e9kOiOkXeVahd0yGQTFLo+ +77Owqk8h0068tQnLZ1pFoVtGqfhV0LU2C4DW7QB1CCm3fF0ZoCGYulMorL/uBEd bvpP/adNxOT+RGad9SedR1AZr6w+zTH86OnbYC7zWRq1de1PFgmI4O/3RoTRXD/f QtCH57bVkY4ASpV2zBj9oPBnJxvkEFcAZ94/DDdD+sEE7PoVYtkBtJ0+J8zlDEnE nKl1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvddttdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepiedvhfeiheehgeeuieeljeeitedtjeehudegfeelkedvleekhedtgfei ffefkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghgvghnthhssehmvgguug grthgrihhntgdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhs thhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Mar 2025 14:26:50 -0400 (EDT) Message-ID: <4835994a-aecf-4fef-bb75-9a4c5f6e0ffd@aklaver.com> Date: Mon, 10 Mar 2025 11:26:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Creating files with testdata To: H , PostgreSQL Users Mailing List References: <84A5765B-1D3C-485B-B852-99D63D53963E@meddatainc.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <84A5765B-1D3C-485B-B852-99D63D53963E@meddatainc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/10/25 11:09 AM, H wrote: > I am developing a complex multi-tenant application in postgresql 16 in Linux. During the development I would like to be able to enter test data into various related tables at any given time for testing purposes. > > While this can certainly be accomplished by predefined CTE INSERT statements in an SQL file, I would prefer something more flexible. I am thinking of using a markdown file as a source for these CTE INSERT statements. Specifically, having a certain structure in the markdown file where a given markdown heading level, bullet level etc. would correspond to specific tables and columns. Why CTE INSERTs? > > After entering my test data into the markdown file for the given test scenario, I would then run an awk script or similar to create a SQL file with the various CTE INSERT statements. Howevever, it gets complex since I need to handle 1:N relationships between tables in the markdown file... > > I hope the above outline is understandable and am interested in comments and thoughts on my above approach. > > Thanks. > > -- Adrian Klaver adrian.klaver@aklaver.com