Bulk Co;y into postgres from within an omis library

Terence Young terry.young at journeymhc.org
Wed Jun 1 16:55:36 UTC 2022


Actually, it pdes.  However, there is limitationin that it hastobe cnverted into a Newline Delimited Jason.

See..
  https://konbert.com/blog/import-json-into-postgres-using-copy

terry
[https://konbert.com/images/logo-card-f99b24ad3d2e88eee5fb04580b97685b.jpg?vsn=d]<https://konbert.com/blog/import-json-into-postgres-using-copy>
Import JSON into Postgres using COPY - Konbert<https://konbert.com/blog/import-json-into-postgres-using-copy>
Loading data into a database is an essential feature that we use very frequently, most databases offer some kind of mechanism to import external data into tables.
konbert.com
If I created a CSV file, how would I pass tht to the copuy command inside an Omnis sql statement?


Terence J. Young, DC

System Administrator

IT

(608) 280-2679

________________________________
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> on behalf of Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com>
Sent: Wednesday, June 1, 2022 10:53 AM
To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Cc: Doug Easterbrook <doug at artsman.com>
Subject: Re: Bulk Co;y into postgres from within an omis library

CAUTION: This email originated from outside Journey. Please verify the sender before opening attachments or clicking links.


the copy command format doesn’t take JSON as input as far as I know.

https://www.postgresql.org/docs/current/sql-copy.html <https://www.postgresql.org/docs/current/sql-copy.html>


I’ve not tried it from within omnis to create a set of commands that psql can execute.

if you do a pg_dump on a table without any compression (i.e, don’t use the -F on the dump command), then you’ll see what the copy command looks like to import many lines




Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On May 31, 2022, at 12:30 PM, Terence Young <terry.young at journeymhc.org> wrote:
>
> Hii,
> I meant to say..
>
> Can a list of data be imported into a jason object and then passed to an sql statement containing the copy command.
>
> terry
>
>
> Terence J. Young, DC
>
> System Administrator
>
> IT
>
> (608) 280-2679
>
> ________________________________
> From: Terence Young <terry.young at journeymhc.org>
> Sent: Tuesday, May 31, 2022 2:19 PM
> To: omnisdev-en at lists.omnis-dev.com <omnisdev-en at lists.omnis-dev.com>
> Subject: Bulk Co;y into postgres from within an omis library
>
> Hi,
> Has anybody been successful in executing a bulk copy, via copy, into a postgres database from within an Omnis library.
>
> Can a list of data be imported into a jason object an sql containing the copy command.
>
> I currently have  large table that I import using ..
>
> Drop indexes
> drop logging on the table
> import using an insert with 1000 rows of data
> set loggin back on for the table
> recreated the indexes
>
> It is still very slow.
>
> terry
>
>
> Terence J. Young, DC
>
> System Administrator
>
> IT
>
> (608) 280-2679
>
> If you received this e-mail in error, please notify the sender, delete the e-mail, and do not use, disclose or store the information it contains. This e-mail and any attachments may contain confidential information, including records protected by WI Mental Health 51.30 and/or AODA federal confidentiality rules (42 CFR Part 2) - both prohibit you from making any further disclosure of this information unless further disclosure is expressly permitted by the written consent of the person to whom it pertains or as otherwise permitted by 51.30 or 42 CFR Part 2. A general authorization for the release of medical or other information is NOT sufficient for this purpose. Federal rules restrict any use of this information to criminally investigate or prosecute any alcohol or drug abuse client.
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com


More information about the omnisdev-en mailing list