No place was found.
No place was found.
there is an auto_increment self-increment field in MySQL. PostgreSQL does not have a self-increment field, but there is a separate object: sequence. You can use sequences or other methods to implement such syntax. Or set the default value of a column to the value of sequence
set nextval ('products_product_no_seq')
in the field default value.
create sequence see https://www.postgresql.org/do.
CREATE SEQUENCE products_product_no_seq START 101;
CREATE TABLE products (
product_no integer DEFAULT nextval('products_product_no_seq'),
...
);
field type can be manually entered serial
or serial8
. A sequence of table name _ field name _ seq
is automatically created
Manual masturbation code can customize the seq name. Just the sauce.
Previous: Why can't files be downloaded by post without form forms?
Next: PHP pdo links to postgresql database. Json is used in where conditions to report errors.