analyze.c.patch

text/plain

Filename: analyze.c.patch
Type: text/plain
Part: 0
Message: Re: [HACKERS] Re: Serial Data Type Failure

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
analyze.c 4 3
*** analyze.c.orig	Wed Sep 16 14:59:22 1998
--- analyze.c	Mon Sep 21 05:18:07 1998
***************
*** 517,528 ****
  
  				if (column->is_sequence)
  				{
! 					char	   *cstring;
  					CreateSeqStmt *sequence;
  
  					constraint = makeNode(Constraint);
  					constraint->contype = CONSTR_DEFAULT;
! 					constraint->name = makeTableName(stmt->relname, column->colname, "seq", NULL);
  					cstring = palloc(9 + strlen(constraint->name) + 2 + 1);
  					strcpy(cstring, "nextval('");
  					strcat(cstring, constraint->name);
--- 517,529 ----
  
  				if (column->is_sequence)
  				{
! 					char		  *sname;
! 					char		  *cstring;
  					CreateSeqStmt *sequence;
  
  					constraint = makeNode(Constraint);
  					constraint->contype = CONSTR_DEFAULT;
! 					constraint->name = sname = makeTableName(stmt->relname, column->colname, "seq", NULL);
  					cstring = palloc(9 + strlen(constraint->name) + 2 + 1);
  					strcpy(cstring, "nextval('");
  					strcat(cstring, constraint->name);
***************
*** 551,557 ****
  					}
  
  					sequence = makeNode(CreateSeqStmt);
! 					sequence->seqname = pstrdup(constraint->name);
  					sequence->options = NIL;
  
  					elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
--- 552,558 ----
  					}
  
  					sequence = makeNode(CreateSeqStmt);
! 					sequence->seqname = pstrdup(sname);
  					sequence->options = NIL;
  
  					elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",