Copy command using OID on Postgresql (Without reading a file from FS)
<p>So, here is the situation:</p>

<p>I have a client that uploads a csv to my application and i save it on a table using OID, then to process the data i create a temporary table from the CSV and distribute the data i want to another tables, it works perfectly fine. But i really don't want to save the csv first on the filesystem every time i want to process it, there's any way to use the file in the db to run the COPY command to a table? What i want is something like this:</p>

<pre><code>COPY temp_table FROM loread(lo_open((SELECT csv_file_oid FROM files_table WHERE liberacao_base_id = 104), 262144), 1000000) WITH DELIMITER ; CSV HEADER;
</code></pre>

<p>Theres a way to do anything like that? I really must save the file on the filesystem to run the COPY command? It seems a lot of resource waste for me if i already have it on my database. Thanks in advance (and sorry for my bad english.)</p>