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 1tridN-007yiX-95 for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 19:17:53 +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 1tridK-00Gt1y-TV for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 19:17:50 +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 1tridK-00Gt1l-Em for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 19:17:50 +0000 Received: from mout.perfora.net ([74.208.4.194]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tridG-0025sZ-2c for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 19:17:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meddatainc.com; s=s1-ionos; t=1741634266; x=1742239066; i=agents@meddatainc.com; bh=i0Qd5c0z4leDpiMuljlM/4X3czv0R7t9IxW3ds+6qIE=; h=X-UI-Sender-Class:Date:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding:Subject:To:From:Message-ID: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=thfOVOHkaKLQlgY+e2LwI7mH0pIv6yOvgPCrUxW3FGYOEsCMY+xB6HHFxYzsP9Av 5U/BbJI2pXTqVilIDEp2cU54+Q2tuKM/7j+EYN9y5ePBaoqpdcZ0ft/sVlNXAOsrf 0RU/Ghbv2WoGo+62uJyjlzY9wNFfj2iB7FTkF/wzZEZw0fqZmM0UX9w7UVS8OjXBN yp1y8DB2R4JZfWkROIvOHsKgvWjPGBQOyHBzMgxLUXPN8YM7NhG2oH1FgdEeUGD+/ RQK0EcDnmf+bqOgd3Cx0CjePFsOMkBcsDJWzyFxv4yn6zxR+C6AE0iIglp/CS72Rj sAMEOVZHU/bu6JlFPg== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from [192.168.106.147] ([96.245.190.98]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MVen3-1tjCpq2vyZ-00KcnI for ; Mon, 10 Mar 2025 20:17:45 +0100 Date: Mon, 10 Mar 2025 15:15:10 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <4835994a-aecf-4fef-bb75-9a4c5f6e0ffd@aklaver.com> References: <84A5765B-1D3C-485B-B852-99D63D53963E@meddatainc.com> <4835994a-aecf-4fef-bb75-9a4c5f6e0ffd@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Creating files with testdata To: pgsql-general@lists.postgresql.org From: H Message-ID: X-Provags-ID: V03:K1:1a3+3rDkuTiOKOqtNPqK20XMX9xIDU0fDHXLMQcOEFJHmIEuSo9 YJOegfwiMSW2nj5EqdEXKYoPqygEz6Ff3Lqsnsl11ZhnFM0+CFrpa/G+tuuSGAAA9ACinUr Jym93MZBKJUjF4JM3N4CN76qT5SyN9VPb2dsJrFjoPj1q9lRC8DTxet55RnxPI7t8X6/HEx uEIK05AB+BrLmzETDn+MQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:UI/BHxTibRE=;7yZVbyAcza6yhSbtSKnZPsu5sxE Fp4OYYgJRXBV1mObgIXKt708H0wvV0VO/sONpvfmPrg5auF9EzMITowhHE1dP7us5o6YnpTpp tAz//JRO8tHmgLkeeuWgxZ3X5xWAh6vILlhgxwDzmk9lOlvbDFwafGOutzKHUNkqxO/ltpMRQ mBIA9/zKduZnpv2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JsT7Zaz8zRdq5QgQMvhGamP67VMlfprH0G35BtscNyXH62h7xvtBaH02Ru g5NboLb2sfUU4vT09mR1cKd3NRrlVkmNKrt5UHai3ytqPK3CAvbYWhT/8VxT27yYJZQ List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On March 10, 2025 2:26:48 PM GMT-04:00, Adrian Klaver wrote: > > >On 3/10/25 11:09 AM, H wrote: >> I am developing a complex multi-tenant application in postgresql 16 >in Linux=2E During the development I would like to be able to enter test >data into various related tables at any given time for testing >purposes=2E >>=20 >> While this can certainly be accomplished by predefined CTE INSERT >statements in an SQL file, I would prefer something more flexible=2E I am >thinking of using a markdown file as a source for these CTE INSERT >statements=2E Specifically, having a certain structure in the markdown >file where a given markdown heading level, bullet level etc=2E would >correspond to specific tables and columns=2E > >Why CTE INSERTs? > >>=20 >> 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=2E Howevever, it gets complex >since I need to handle 1:N relationships between tables in the markdown >file=2E=2E=2E >>=20 >> I hope the above outline is understandable and am interested in >comments and thoughts on my above approach=2E >>=20 >> Thanks=2E >>=20 >>=20 There are tables referencing each other using randomly generated IDs, ie= =2E those IDs are not known until after the parent table row is inserted=2E