Search Postgresql Archives

Re: 9.6.1: INSERT with PK as serial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rich Shepard <rshepard@xxxxxxxxxxxxxxx> writes:
>    Here's an example:

> INSERT INTO companies VALUES
>    (1,'AG Spray Inc.',,'PO Box 12129','Salem','OR','97309-0129','USA','503-371-7907','888-273-0937','info@xxxxxxxxxxxxxx',,'Chemicals','Opportunity'),

> and the associated error message:

> psql:companies.sql:1: ERROR:  syntax error at or near "Spray"
> LINE 1: INSERT INTO companies VALUES (AG Spray Inc.,,PO Box 12129,Sa...

It looks like something deleted the quote marks.  How are you entering
this SQL command, exactly?

Also, you can't just write double commas to leave out a item in the
value list.  You could write DEFAULT there, ie

      ... VALUES (1,'AG Spray Inc.',DEFAULT,'PO Box 12129','Salem', ...

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux