I'm trying to do an insert into PHPPGadmin into one of my tables:
INSERT INTO teachers (first_name,last_name,school,hire_date,salary) VALUES ('Ron','Buckby','F.D. Roosevelt School','04-17-1979',34900);
And I get an error back:
SQL error:
ERROR: syntax error at or near "INTO"
LINE 1: SELECT COUNT(*) AS total FROM (INSERT INTO teachers (first_n...
^
In statement:
SELECT COUNT(*) AS total FROM (INSERT INTO teachers (first_name,last_name,school,hire_date,salary) VALUES ('Ron','Buckby','F.D. Roosevelt School','04-17-1979',34900)) AS sub
However if I do the same exact insert on the command line it works:
analysis=# INSERT INTO teachers (first_name,last_name,school,hire_date,salary) VALUES ('Ron','Buckby','F.D. Roosevelt School','04-17-1979',34900);
INSERT 0 1
I can then do a select on the data:
SELECT * FROM teachers WHERE first_name ilike 'ron' AND last_name ilike 'buckby';
id | first_name | last_name | school | hire_date | salary
----+------------+-----------+-----------------------+------------+--------
16 | Ron | Buckby | F.D. Roosevelt School | 1979-04-17 | 34900
(1 row)
Why does this insert fail only when I use PHPPGAdmin?