Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how execute COPY statement in pgAdmin

I usually use the CUSTOM backup restore but got an error, so I went with the plain text option to see if I detect where is the error.

I load it the backup file on pgAdmin / SQL Editor, can create the tables and function but get an error on the load data section.

This is the small table. Where I save what is the current snapshot.

CREATE TABLE rt_version (
    traffic_version timestamp without time zone
);


ALTER TABLE traffic.rt_version OWNER TO postgres;

COPY rt_version (traffic_version) FROM stdin;
2016-05-11 14:35:00.095
\.

enter image description here

like image 709
Juan Carlos Oropeza Avatar asked Oct 25 '25 12:10

Juan Carlos Oropeza


1 Answers

In PgAdmin's main screen's menu, there's a main menu "Plugins", which will likely have a submenu "PSQL Console". That will open a psql connected to the database you have selected, and you can use COPY FROM STDIN in it.

like image 117
Ezequiel Tolnay Avatar answered Oct 28 '25 03:10

Ezequiel Tolnay