Postgresql and mysql

25 views
Skip to first unread message

Salima Begum

unread,
May 18, 2020, 7:51:09 AM5/18/20
to django...@googlegroups.com
Hi ,
Mysql query which we used previously now we moved to postgresql,
Here is the below query in mysql , Can anyone help me to write similar query in postgresql.

query = "LOAD DATA LOCAL INFILE '41098_category_list.txt' INTO TABLE pages_rim_ls_categories FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n' "

Thanks
~salima

Ram

unread,
May 23, 2020, 2:04:17 PM5/23/20
to django...@googlegroups.com
Hello Salima,

You could use the COPY command that is documented here.


But if the data is bulk and that data has to be copied or inserted into the table in a faster manner, your ideal solution is Pgloader because of its performance benefits.


HTH,
~Ram




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6bnNUZ0XK%3DBbnwhNrEcVEe6Lpab0uazxvXtskZcR_MZ2uA%40mail.gmail.com.

Sebastian Jung

unread,
May 23, 2020, 2:38:04 PM5/23/20
to django...@googlegroups.com
Hey you can Import Files on a Terminal with sudo -u postgres psql < File.txt

--
Reply all
Reply to author
Forward
0 new messages