Re: Creating files with testdata

From: H <agents(at)meddatainc(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Creating files with testdata
Date: 2025-03-10 19:15:10
Message-ID: EEE7D9EB-CDFE-420F-9A84-A51E80EC644B@meddatainc.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On March 10, 2025 2:26:48 PM GMT-04:00, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
>
>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.
>>
>>

There are tables referencing each other using randomly generated IDs, ie. those IDs are not known until after the parent table row is inserted.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2025-03-10 19:21:57 Re: Creating files with testdata
Previous Message Adrian Klaver 2025-03-10 18:26:48 Re: Creating files with testdata