I want to copy some data from a table to another but I dont want to copy all the rows, just a few a them (like only the first 100).
I didn't find an option in the COPY command for this.
So that's only possible or not ?
Thank you in advance.
You didn't look very hard.
https://www.postgresql.org/docs/current/static/sql-copy.html
To copy into a file just the countries whose names start with 'A':
COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy';
So you would want COPY (SELECT ... LIMIT 100).
I'm assuming you want to copy between databases or via an intermediate file or something, otherwise you just want to use INSERT ... SELECT as shown in another answer.
You can use
INSERT INTO table2(col_list)
SELECT col_list FROM table1 WHERE condtitions ORDER BY order_col_list LIMIT X;