Devault values for Row in PGSQL
Posted: Thu Jan 15, 2009 7:09 pm
I have a query:
INSERT INTO tr_projects () VALUES ()
which errors. In another thread I found that this will error UNLESS there are default values specified for every column in tr_projects.
There are in fact default values specified; there are 2 (there are 2 columns in tr_projects) and they are:
1) nextval('tr_projects_id_seq'::regclass)
2) 0
But when I run the query, it errors:
Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near ")" LINE 1: INSERT INTO tr_projects () VALUES () ^ in C:\Program Files\BitNami WAPPStack\apache2\htdocs\ascprojects\tracker\pgsql_database.php on line 186
Is there a setting I have to change in PGSQL to make it use the default values automatically? Why doesnt it take the default values specified?
INSERT INTO tr_projects () VALUES ()
which errors. In another thread I found that this will error UNLESS there are default values specified for every column in tr_projects.
There are in fact default values specified; there are 2 (there are 2 columns in tr_projects) and they are:
1) nextval('tr_projects_id_seq'::regclass)
2) 0
But when I run the query, it errors:
Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near ")" LINE 1: INSERT INTO tr_projects () VALUES () ^ in C:\Program Files\BitNami WAPPStack\apache2\htdocs\ascprojects\tracker\pgsql_database.php on line 186
Is there a setting I have to change in PGSQL to make it use the default values automatically? Why doesnt it take the default values specified?