I am attempting to import a text file into a postgresql database
This is the code I am using
pg_exec( $database, 'BEGIN' );
pg_loimport( $database, 'stdin.txt' );
pg_exec( $database, 'END' );
When I run the page I get the error:
Warning: Supplied argument is not a valid PostgreSQL link resource in /usr/.../import.php on line 7
(Line 7 is the pg_loimport)
I attempted to use the newer standard of pg_lo_import and pg_query but none of that worked.
Someone mind telling me what error I am making.
For starters I am unsure as to where to put the table name.
I had to search a long time to find this information in the first place.
I can't access the page via telnet to use copy or /copy to insert the text file into the table so I have to use the website.
Thanks
Colm
p.s.
If there is another way to import a text file I am all ears (well eyes).
🙂