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 1triih-0081NY-TV for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 19:23:24 +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 1triif-00Gyzb-R4 for pgsql-general@arkaria.postgresql.org; Mon, 10 Mar 2025 19:23:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1triif-00GyzQ-Bq for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 19:23:21 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1triid-0025Gy-0X for pgsql-general@lists.postgresql.org; Mon, 10 Mar 2025 19:23:20 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5e5e63162a0so5106395a12.3 for ; Mon, 10 Mar 2025 12:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peoplecall-com.20230601.gappssmtp.com; s=20230601; t=1741634598; x=1742239398; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ljPJDNWYfsrppipXYoEa4318AmgWrU8PTtoglzOWUVo=; b=IZHWJSwk1SzI9e3qYhhbsQqPqA0F2xfaSvJcnW4EevaX7tCZ/qWf+ccHqz/yODTbB3 l6yds4ZyRcvU/wXgi+DJ+aH7VsIGvb65l8rmmDGKO3xXjNQ7Ifl4QSdQtbzvBZ8Sv8sg mH9uIRhb7oHEUzYUJoyFzf2J8s3Gre2ae6z/MmkV/NQkyijbkhZYbl1O++8dHTzyUwGW d8X7dazBVjbljIhoh5Z9+qZ55fnqYFKRq1XnlcJJ1VI776JWADf4FMZVTc9j8sylqrbf Cikxfm7zPjzaE0tRDPPlnXC2WtqsI4O3RTxSJDNxccBSi8CsiJGxMnUHi082VrXo/Pst ezzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741634598; x=1742239398; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ljPJDNWYfsrppipXYoEa4318AmgWrU8PTtoglzOWUVo=; b=mq+m9GJyWsNRrxPrm0WSGKs1zDazTzsIA/F6wuTbg1sNisaf7MGG4YsZQTLrSdwAy2 5L/K7IS12OZ4HFCuqa2/YBg3Una31kdPp540g54pYmr4kVWXtiYqcV2EKeQwJb9P7ChH snU75GrXgWDnLx55D3bpbIGEwQUVoGXAwvqgBmieDUYjmaEcQZ2hwIOAugF0u1KqjvFc 30ccw0VApdgmnzjqyk1dSZsmKoPL+S0EXbYkXgPzBM30RfpyKO9e147hjP89+KSXfHw3 UTiWpXU2ipvaETbocM6oGY+PEkGoLq0XKkCEAaANB0hykdq90rMtmZDhja8VcuXTm8AO 2v8A== X-Gm-Message-State: AOJu0Yyd/c9ThEaGy+kpyvlB3g61noHxoTHFel4fmXdFG45B3FzUGaVe QlA+xjuOIS1cYII6ck6TpZaHaetEOnbZm2tOLvWwGVOTtnMSzReLroPPIP1KPa1kt+i/diZkWyc k0HwoUVGObcgpDY7ceC84u47z24B/d+BVuVgUF9amXgoZx70= X-Gm-Gg: ASbGnctMVIB2O07WghKGPIiYq/JZEkaMGcT98Z+YoI2DZSxdJtoc+6UOluNNEY63uQF BWWHtOKVAYywKSbZilZl96sVtJxXspDFRvoc7jwU/bZw1JUtDCQVRqCQPU9GrgbX2S++4nCzBHf pwaUZ+VKrzmPtT6+0j7VS8MvgXqCI= X-Google-Smtp-Source: AGHT+IHFNz0gr5Df658tNYmSw134betIVMJdzzjOc9gvh5pLoDOxdvdDbV0ZZbhGExqFlbQhuqrdn5ToQFvNBabZOzA= X-Received: by 2002:a05:6402:42c3:b0:5e4:cfe8:3502 with SMTP id 4fb4d7f45d1cf-5e75e43614emr1134962a12.17.1741634597746; Mon, 10 Mar 2025 12:23:17 -0700 (PDT) MIME-Version: 1.0 References: <84A5765B-1D3C-485B-B852-99D63D53963E@meddatainc.com> In-Reply-To: <84A5765B-1D3C-485B-B852-99D63D53963E@meddatainc.com> From: Francisco Olarte Date: Mon, 10 Mar 2025 20:22:41 +0100 X-Gm-Features: AQ5f1JpW6EGu4fk2cAAJaaStoaOqAyIAAHqx5xEZPv7ln2z3BzpRLL48CUKDcic Message-ID: Subject: Re: Creating files with testdata To: H Cc: PostgreSQL Users Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 10 Mar 2025 at 19:17, H wrote: ... > After entering my test data into the markdown file for the given test sce= nario, 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. I do not think MD would be a good source format. Being a developer I would recommend taking your favorite scripting language ( perl / python / lua / js , whatever ), build a big object ( which can be easily helped by some mini-functions to build a little DSL ) and then spit sql from it ( for developemewnt it is normally better then using whatever db connection your language has, as it leaves an understandable sql script ). I have done this with perl for some projects, built a driver which defined several helper functions, then dofile("xx.dat") which returned a big hash and then a series of loops on the result to write the SQL in whatever order was neccessary. Francisco Olarte.