Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd28aafb

Browse files
committed
Remove pg_control's enableIntTimes field.
We don't need it any more.pg_controldata continues to report that date/time type storage is"64-bit integers", but that's now a hard-wired behavior not somethingit sees in the data. This avoids breaking pg_upgrade, and perhaps otherutilities that inspect pg_control this way. Ditto for pg_resetwal.I chose to remove the "bigint_timestamps" output column ofpg_control_init(), though, as that function hasn't been around longand probably doesn't have ossified users.Discussion:https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
1 parentb6aa17e commitd28aafb

File tree

8 files changed

+16
-53
lines changed

8 files changed

+16
-53
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17655,11 +17655,6 @@ SELECT collation for ('foo' COLLATE "de_DE");
1765517655
<entry><type>integer</type></entry>
1765617656
</row>
1765717657

17658-
<row>
17659-
<entry><literal>bigint_timestamps</literal></entry>
17660-
<entry><type>boolean</type></entry>
17661-
</row>
17662-
1766317658
<row>
1766417659
<entry><literal>float4_pass_by_value</literal></entry>
1766517660
<entry><type>boolean</type></entry>

‎src/backend/access/transam/xlog.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4379,11 +4379,6 @@ WriteControlFile(void)
43794379
ControlFile->toast_max_chunk_size=TOAST_MAX_CHUNK_SIZE;
43804380
ControlFile->loblksize=LOBLKSIZE;
43814381

4382-
#ifdefHAVE_INT64_TIMESTAMP
4383-
ControlFile->enableIntTimes= true;
4384-
#else
4385-
ControlFile->enableIntTimes= false;
4386-
#endif
43874382
ControlFile->float4ByVal=FLOAT4PASSBYVAL;
43884383
ControlFile->float8ByVal=FLOAT8PASSBYVAL;
43894384

@@ -4579,22 +4574,6 @@ ReadControlFile(void)
45794574
ControlFile->loblksize, (int)LOBLKSIZE),
45804575
errhint("It looks like you need to recompile or initdb.")));
45814576

4582-
#ifdefHAVE_INT64_TIMESTAMP
4583-
if (ControlFile->enableIntTimes!= true)
4584-
ereport(FATAL,
4585-
(errmsg("database files are incompatible with server"),
4586-
errdetail("The database cluster was initialized without HAVE_INT64_TIMESTAMP"
4587-
" but the server was compiled with HAVE_INT64_TIMESTAMP."),
4588-
errhint("It looks like you need to recompile or initdb.")));
4589-
#else
4590-
if (ControlFile->enableIntTimes!= false)
4591-
ereport(FATAL,
4592-
(errmsg("database files are incompatible with server"),
4593-
errdetail("The database cluster was initialized with HAVE_INT64_TIMESTAMP"
4594-
" but the server was compiled without HAVE_INT64_TIMESTAMP."),
4595-
errhint("It looks like you need to recompile or initdb.")));
4596-
#endif
4597-
45984577
#ifdefUSE_FLOAT4_BYVAL
45994578
if (ControlFile->float4ByVal!= true)
46004579
ereport(FATAL,

‎src/backend/utils/misc/pg_controldata.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ pg_control_recovery(PG_FUNCTION_ARGS)
266266
Datum
267267
pg_control_init(PG_FUNCTION_ARGS)
268268
{
269-
Datumvalues[13];
270-
boolnulls[13];
269+
Datumvalues[12];
270+
boolnulls[12];
271271
TupleDesctupdesc;
272272
HeapTuplehtup;
273273
ControlFileData*ControlFile;
@@ -277,7 +277,7 @@ pg_control_init(PG_FUNCTION_ARGS)
277277
* Construct a tuple descriptor for the result row. This must match this
278278
* function's pg_proc entry!
279279
*/
280-
tupdesc=CreateTemplateTupleDesc(13, false);
280+
tupdesc=CreateTemplateTupleDesc(12, false);
281281
TupleDescInitEntry(tupdesc, (AttrNumber)1,"max_data_alignment",
282282
INT4OID,-1,0);
283283
TupleDescInitEntry(tupdesc, (AttrNumber)2,"database_block_size",
@@ -296,13 +296,11 @@ pg_control_init(PG_FUNCTION_ARGS)
296296
INT4OID,-1,0);
297297
TupleDescInitEntry(tupdesc, (AttrNumber)9,"large_object_chunk_size",
298298
INT4OID,-1,0);
299-
TupleDescInitEntry(tupdesc, (AttrNumber)10,"bigint_timestamps",
299+
TupleDescInitEntry(tupdesc, (AttrNumber)10,"float4_pass_by_value",
300300
BOOLOID,-1,0);
301-
TupleDescInitEntry(tupdesc, (AttrNumber)11,"float4_pass_by_value",
301+
TupleDescInitEntry(tupdesc, (AttrNumber)11,"float8_pass_by_value",
302302
BOOLOID,-1,0);
303-
TupleDescInitEntry(tupdesc, (AttrNumber)12,"float8_pass_by_value",
304-
BOOLOID,-1,0);
305-
TupleDescInitEntry(tupdesc, (AttrNumber)13,"data_page_checksum_version",
303+
TupleDescInitEntry(tupdesc, (AttrNumber)12,"data_page_checksum_version",
306304
INT4OID,-1,0);
307305
tupdesc=BlessTupleDesc(tupdesc);
308306

@@ -339,18 +337,15 @@ pg_control_init(PG_FUNCTION_ARGS)
339337
values[8]=Int32GetDatum(ControlFile->loblksize);
340338
nulls[8]= false;
341339

342-
values[9]=BoolGetDatum(ControlFile->enableIntTimes);
340+
values[9]=BoolGetDatum(ControlFile->float4ByVal);
343341
nulls[9]= false;
344342

345-
values[10]=BoolGetDatum(ControlFile->float4ByVal);
343+
values[10]=BoolGetDatum(ControlFile->float8ByVal);
346344
nulls[10]= false;
347345

348-
values[11]=BoolGetDatum(ControlFile->float8ByVal);
346+
values[11]=Int32GetDatum(ControlFile->data_checksum_version);
349347
nulls[11]= false;
350348

351-
values[12]=Int32GetDatum(ControlFile->data_checksum_version);
352-
nulls[12]= false;
353-
354349
htup=heap_form_tuple(tupdesc,values,nulls);
355350

356351
PG_RETURN_DATUM(HeapTupleGetDatum(htup));

‎src/bin/pg_controldata/pg_controldata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,9 @@ main(int argc, char *argv[])
293293
ControlFile->toast_max_chunk_size);
294294
printf(_("Size of a large-object chunk: %u\n"),
295295
ControlFile->loblksize);
296+
/* This is no longer configurable, but users may still expect to see it: */
296297
printf(_("Date/time type storage: %s\n"),
297-
(ControlFile->enableIntTimes ?_("64-bit integers") :_("floating-point numbers")));
298+
_("64-bit integers"));
298299
printf(_("Float4 argument passing: %s\n"),
299300
(ControlFile->float4ByVal ?_("by value") :_("by reference")));
300301
printf(_("Float8 argument passing: %s\n"),

‎src/bin/pg_resetwal/pg_resetwal.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,6 @@ GuessControlValues(void)
598598
ControlFile.indexMaxKeys=INDEX_MAX_KEYS;
599599
ControlFile.toast_max_chunk_size=TOAST_MAX_CHUNK_SIZE;
600600
ControlFile.loblksize=LOBLKSIZE;
601-
#ifdefHAVE_INT64_TIMESTAMP
602-
ControlFile.enableIntTimes= true;
603-
#else
604-
ControlFile.enableIntTimes= false;
605-
#endif
606601
ControlFile.float4ByVal=FLOAT4PASSBYVAL;
607602
ControlFile.float8ByVal=FLOAT8PASSBYVAL;
608603

@@ -688,8 +683,9 @@ PrintControlValues(bool guessed)
688683
ControlFile.toast_max_chunk_size);
689684
printf(_("Size of a large-object chunk: %u\n"),
690685
ControlFile.loblksize);
686+
/* This is no longer configurable, but users may still expect to see it: */
691687
printf(_("Date/time type storage: %s\n"),
692-
(ControlFile.enableIntTimes ?_("64-bit integers") :_("floating-point numbers")));
688+
_("64-bit integers"));
693689
printf(_("Float4 argument passing: %s\n"),
694690
(ControlFile.float4ByVal ?_("by value") :_("by reference")));
695691
printf(_("Float8 argument passing: %s\n"),

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201702101
56+
#defineCATALOG_VERSION_NO201702231
5757

5858
#endif

‎src/include/catalog/pg_control.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
/* Version identifier for this pg_control format */
24-
#definePG_CONTROL_VERSION960
24+
#definePG_CONTROL_VERSION1001
2525

2626
/*
2727
* Body of CheckPoint XLOG records. This is declared here because we keep
@@ -215,9 +215,6 @@ typedef struct ControlFileData
215215
uint32toast_max_chunk_size;/* chunk size in TOAST tables */
216216
uint32loblksize;/* chunk size in pg_largeobject */
217217

218-
/* flag indicating internal format of timestamp, interval, time */
219-
boolenableIntTimes;/* int64 storage enabled? */
220-
221218
/* flags indicating pass-by-value status of various types */
222219
boolfloat4ByVal;/* float4 pass-by-value? */
223220
boolfloat8ByVal;/* float8, int8, etc pass-by-value? */

‎src/include/catalog/pg_proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5355,7 +5355,7 @@ DESCR("pg_controldata checkpoint state information as a function");
53555355
DATA(insert OID = 3443 ( pg_control_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,23,3220,3220,16}" "{o,o,o,o,o}" "{min_recovery_end_location,min_recovery_end_timeline,backup_start_location,backup_end_location,end_of_backup_record_required}" _null_ _null_ pg_control_recovery _null_ _null_ _null_ ));
53565356
DESCR("pg_controldata recovery state information as a function");
53575357

5358-
DATA(insert OID = 3444 ( pg_control_init PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,23,23,23,23,23,23,23,16,16,16,23}" "{o,o,o,o,o,o,o,o,o,o,o,o,o}" "{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,bigint_timestamps,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}" _null_ _null_ pg_control_init _null_ _null_ _null_ ));
5358+
DATA(insert OID = 3444 ( pg_control_init PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,23,23,23,23,23,23,23,16,16,23}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}" _null_ _null_ pg_control_init _null_ _null_ _null_ ));
53595359
DESCR("pg_controldata init state information as a function");
53605360

53615361
DATA(insert OID = 3445 ( pg_import_system_collations PGNSP PGUID 12 100 0 0 0 f f f f t f v r 2 0 2278 "16 4089" _null_ _null_ "{if_not_exists,schema}" _null_ _null_ pg_import_system_collations _null_ _null_ _null_ ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp