1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* bootstrap.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* include file for the bootstrapping code
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
2019-01-02 18:44:25 +01:00
|
|
|
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/bootstrap/bootstrap.h
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef BOOTSTRAP_H
|
|
|
|
#define BOOTSTRAP_H
|
|
|
|
|
2000-07-15 00:18:02 +02:00
|
|
|
#include "nodes/execnodes.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2009-09-27 03:32:11 +02:00
|
|
|
|
2001-05-12 03:48:49 +02:00
|
|
|
/*
|
|
|
|
* MAXATTR is the maximum number of attributes in a relation supported
|
|
|
|
* at bootstrap time (i.e., the max possible in a system table).
|
2000-07-15 00:18:02 +02:00
|
|
|
*/
|
|
|
|
#define MAXATTR 40
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2015-02-21 22:25:49 +01:00
|
|
|
#define BOOTCOL_NULL_AUTO 1
|
|
|
|
#define BOOTCOL_NULL_FORCE_NULL 2
|
2015-05-24 03:35:49 +02:00
|
|
|
#define BOOTCOL_NULL_FORCE_NOT_NULL 3
|
2015-02-21 22:25:49 +01:00
|
|
|
|
2002-04-27 23:24:34 +02:00
|
|
|
extern Relation boot_reldesc;
|
1998-09-01 05:29:17 +02:00
|
|
|
extern Form_pg_attribute attrtypes[MAXATTR];
|
1997-09-08 04:41:22 +02:00
|
|
|
extern int numattr;
|
2000-06-18 01:41:51 +02:00
|
|
|
|
2009-09-27 03:32:11 +02:00
|
|
|
|
2015-03-26 19:03:19 +01:00
|
|
|
extern void AuxiliaryProcessMain(int argc, char *argv[]) pg_attribute_noreturn();
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void closerel(char *name);
|
|
|
|
extern void boot_openrel(char *name);
|
|
|
|
|
2015-02-21 22:25:49 +01:00
|
|
|
extern void DefineAttr(char *name, char *type, int attnum, int nullness);
|
Remove WITH OIDS support, change oid catalog column visibility.
Previously tables declared WITH OIDS, including a significant fraction
of the catalog tables, stored the oid column not as a normal column,
but as part of the tuple header.
This special column was not shown by default, which was somewhat odd,
as it's often (consider e.g. pg_class.oid) one of the more important
parts of a row. Neither pg_dump nor COPY included the contents of the
oid column by default.
The fact that the oid column was not an ordinary column necessitated a
significant amount of special case code to support oid columns. That
already was painful for the existing, but upcoming work aiming to make
table storage pluggable, would have required expanding and duplicating
that "specialness" significantly.
WITH OIDS has been deprecated since 2005 (commit ff02d0a05280e0).
Remove it.
Removing includes:
- CREATE TABLE and ALTER TABLE syntax for declaring the table to be
WITH OIDS has been removed (WITH (oids[ = true]) will error out)
- pg_dump does not support dumping tables declared WITH OIDS and will
issue a warning when dumping one (and ignore the oid column).
- restoring an pg_dump archive with pg_restore will warn when
restoring a table with oid contents (and ignore the oid column)
- COPY will refuse to load binary dump that includes oids.
- pg_upgrade will error out when encountering tables declared WITH
OIDS, they have to be altered to remove the oid column first.
- Functionality to access the oid of the last inserted row (like
plpgsql's RESULT_OID, spi's SPI_lastoid, ...) has been removed.
The syntax for declaring a table WITHOUT OIDS (or WITH (oids = false)
for CREATE TABLE) is still supported. While that requires a bit of
support code, it seems unnecessary to break applications / dumps that
do not use oids, and are explicit about not using them.
The biggest user of WITH OID columns was postgres' catalog. This
commit changes all 'magic' oid columns to be columns that are normally
declared and stored. To reduce unnecessary query breakage all the
newly added columns are still named 'oid', even if a table's column
naming scheme would indicate 'reloid' or such. This obviously
requires adapting a lot code, mostly replacing oid access via
HeapTupleGetOid() with access to the underlying Form_pg_*->oid column.
The bootstrap process now assigns oids for all oid columns in
genbki.pl that do not have an explicit value (starting at the largest
oid previously used), only oids assigned later by oids will be above
FirstBootstrapObjectId. As the oid column now is a normal column the
special bootstrap syntax for oids has been removed.
Oids are not automatically assigned during insertion anymore, all
backend code explicitly assigns oids with GetNewOidWithIndex(). For
the rare case that insertions into the catalog via SQL are called for
the new pg_nextoid() function can be used (which only works on catalog
tables).
The fact that oid columns on system tables are now normal columns
means that they will be included in the set of columns expanded
by * (i.e. SELECT * FROM pg_class will now include the table's oid,
previously it did not). It'd not technically be hard to hide oid
column by default, but that'd mean confusing behavior would either
have to be carried forward forever, or it'd cause breakage down the
line.
While it's not unlikely that further adjustments are needed, the
scope/invasiveness of the patch makes it worthwhile to get merge this
now. It's painful to maintain externally, too complicated to commit
after the code code freeze, and a dependency of a number of other
patches.
Catversion bump, for obvious reasons.
Author: Andres Freund, with contributions by John Naylor
Discussion: https://postgr.es/m/20180930034810.ywp2c7awz7opzcfr@alap3.anarazel.de
2018-11-21 00:36:57 +01:00
|
|
|
extern void InsertOneTuple(void);
|
2001-08-10 20:57:42 +02:00
|
|
|
extern void InsertOneValue(char *value, int i);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void InsertOneNull(int i);
|
2009-09-27 03:32:11 +02:00
|
|
|
|
|
|
|
extern void index_register(Oid heap, Oid ind, IndexInfo *indexInfo);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void build_indices(void);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2006-08-16 00:36:17 +02:00
|
|
|
extern void boot_get_type_io_data(Oid typid,
|
2019-05-22 19:04:48 +02:00
|
|
|
int16 *typlen,
|
|
|
|
bool *typbyval,
|
|
|
|
char *typalign,
|
|
|
|
char *typdelim,
|
|
|
|
Oid *typioparam,
|
|
|
|
Oid *typinput,
|
|
|
|
Oid *typoutput);
|
2006-08-16 00:36:17 +02:00
|
|
|
|
2006-03-07 02:03:12 +01:00
|
|
|
extern int boot_yyparse(void);
|
|
|
|
|
|
|
|
extern int boot_yylex(void);
|
2015-03-26 19:03:19 +01:00
|
|
|
extern void boot_yyerror(const char *str) pg_attribute_noreturn();
|
2000-01-20 06:34:32 +01:00
|
|
|
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
|
|
|
#endif /* BOOTSTRAP_H */
|