Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

275
Views
¿Admite Postgres para establecer el valor de inicio en la definición de serie?

Aquí hay una pregunta sobre cómo cambiar el valor de serie con la palabra clave alter . ¿Se puede hacer esto en la definición de creación de tabla? Como eso:

 CREATE TABLE tablename ( colname SERIAL stars 1000 );
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puedes probar esta consulta. A mí me funcionó.

 CREATE SEQUENCE tablename_colname_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 ---> here you can mention startup nummber as you need CACHE 1; CREATE TABLE tablename ( colname integer NOT NULL DEFAULT nextval('tablename_colname_seq') );
over 4 years ago · Santiago Trujillo Report

0

Columnas de identidad

Actualmente no hay forma de hacer esto en un comando CREATE TABLE en PostgreSQL 9.x usando la sintaxis de tipo serial específica de PostgreSQL. Sin embargo, viene en PostgreSQL 10 usando la sintaxis de columnas de identidad estandarizadas, vea mi respuesta aquí

Así es como se verá

 CREATE TABLE foo ( id int GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] );

Donde (sequence_options) es START WITH 1000 , entonces algo como esto.

 CREATE TABLE foo ( foo_id int GENERATED ALWAYS AS IDENTITY (START WITH 1000) );
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!