Originally posted by: Carl Uman
I did the same thing but MySQL jumped out and bit me
I already do CF/MSSQL but looking to do PostgreSQL/PHP on linux at home LOL
It shouldn't be too tough.
I run postgres on my server at home.
I import my data a bit differently then the CSV method (because I am dealing with directory names inside a directory in the format of NAMEA - NAMEB - NAMEC and also because I'm used to doing it this way)
I just do a ls -1 to an out file and use tr -d ' ' to wipe out spaces.
Then I just import my data using a delimiter of the dash
COPY tablename FROM '/path/to/file' using DELIMITERS '-' with NULL as '';
Of course to do it this way, the actual construction of the table must be complete first ...
Mine is something like this (at least my big simple table)
CREATE TABLE "tablename" ("variable1" character varying(20), "variable2" character varying(20), "variable3" character varying(6));
REVOKE ALL on "tablename" from PUBLIC;
GRANT SELECT on "tablename" to "apache";
to the OP ... I don't know much about the differences between mysql and postgresql ... but given the popularity of mysql, I'd think it should not be any more complicated then the above postgresql steps .... (the create table part should be exactly the same, just don't know if it can do a copy from a file, or what not)