postgresql/src
Tom Lane e0f05cd5ba Improve some ancient, crufty code in bootstrap + initdb.
At some point back in the last century, somebody felt that reading
all of pg_type twice was cheaper, or at least easier, than using
repalloc() to resize the Typ[] array dynamically.  That seems like an
entirely wacko proposition, so rewrite the code to do it the other
way.  (To add insult to injury, there were two not-quite-identical
copies of said code.)

initdb.c's readfile() function had the same disease of preferring
to do double the I/O to avoid resizing its output array.  Here,
we can make things easier by using the just-invented pg_get_line()
function to handle reading individual lines without a predetermined
notion of how long they are.

On my machine, it's difficult to detect any net change in the
overall runtime of initdb from these changes; but they should
help on slower buildfarm machines (especially since a buildfarm
cycle involves a lot of initdb's these days).

My attention was drawn to these places by scan-build complaints,
but on inspection they needed a lot more work than just suppressing
dead stores :-(
2020-09-05 16:20:04 -04:00
..
backend Improve some ancient, crufty code in bootstrap + initdb. 2020-09-05 16:20:04 -04:00
bin Improve some ancient, crufty code in bootstrap + initdb. 2020-09-05 16:20:04 -04:00
common Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
fe_utils Move connect.h from fe_utils to src/include/common. 2020-08-10 09:22:54 -07:00
include Use multi-inserts for pg_depend 2020-09-05 13:52:47 +09:00
interfaces Teach libpq to handle arbitrary-length lines in .pgpass files. 2020-09-01 13:14:44 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Remove unused parameter 2020-09-02 15:17:33 +02:00
port Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Switch to multi-inserts when registering dependencies for many code paths 2020-09-05 21:33:53 +09:00
timezone Ensure that distributed timezone abbreviation files are plain ASCII. 2020-07-17 11:03:55 -04:00
tools Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
tutorial doc: Change table alias names to lower case in tutorial chapter 2020-09-04 08:45:57 +02:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Update Unicode data to Unicode 13.0.0 and CLDR 37 2020-04-24 09:52:59 +02:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00