OpenLLM-France/wikimedia huggingface dataset:
# PostgreSQL/Transactions

All data-changing operations like INSERT, UPDATE, or DELETE must run within a surrounding construct which is called a TRANSACTION. Transactions are created with the SQL command BEGIN and finished with either COMMIT or ROLLBACK. During the lifetime of the transaction the changes to the database are written only preliminarily. At the end, COMMIT finishes the transaction regularily and commits all intended data changes, or ROLLBACK aborts the transaction and reverts all those preliminary changes.
In addition to this explicit usage of SQL keywords to manage transactions, some of PostgreSQL's client libraries create implicitly a new transaction if one of the data-changing operations doesn't run in an explicitly created transaction. In this case, the operation is automatically committed immediately after its execution.
    Hint: When working within a procedure or function, there is a DECLARE ... BEGIN ... END; construct to define 'blocks'. In this context the meaning of BEGIN (no semikolon after BEGIN!) differs from what is explained here. You can avoid the ambiguity by using the keywords START TRANSACTION; as an alternative for BEGIN; in the context of transactions. Besides that, START TRANSACTION; conforms to the SQL standard.
Transactions generate a great relief for applications. Especially for business logic that must execute many statements as a consistent unit - like the above money transfer from one bank account to another -, there is no need to take individual actions after an error occurred in the middle of a transaction. In many cases it's enough to restart the transaction or to handle errors in a unified way.
Transactions in PostgreSQL guarantee that all requirements of the ACID paradigm are fulfilled, see next chapter.

## Sub-Transactions

Within a transaction the keyword SAVEPOINT defines and denotes a position, to which the transaction may be rolled-back.
# PostgreSQL/WAL

WAL (Write Ahead Logging) files are files, where PostgreSQL stores changed data values in a binary format. It is additional information and in this respect it is redundant to the information in the database files. WAL files can be interpreted as a specific kind of 'diff' files.
WAL files are used for:
* Recreation of a consistent state of the database after a system crash
* Backup and restore with the technique Continuous archiving
* Replication

## Usage

Writing to WAL files is very fast as they are written always sequentially. This is particularly true for traditional discs with rotating panes and moving read/write heads. In contrast to WAL files database files are organized in special structures like trees, which possibly must be reorganized during write operations or which contain pointers to other blocks at far positions. Thus writes to database files are much slower.
For the mentioned performance reasons, when a client requests a write operation like UPDATE or DELETE the modifications to the data are done in a special sequence and - in some parts - asynchronously to the client requests. First, data is written and flushed to WAL files. Second, it is stored in shared buffers in RAM. Finally, it is written from shared buffers to database files. The client doesn't wait until the end of all operations. After the first two very fast actions, he is informed that his request is completed. The third operation is performed asynchronously at a later (or prior) point in time.

## Removal

WAL files are collected in the directory pg_wal (pg_xlog in PostgreSQL versions prior to version 10). Depending on the write activities on the database the total size of all WAL files may increase dramatically. Therefore the system must delete them when they are no longer needed. WAL files are available for deletion after the changes in the shared buffers (which correlate to the content of the WAL files) are flushed to the database files. As it is guaranteed that this criterion is met after a CHECKPOINT, there are some dependencies between WAL file delete operations and CHECKPOINTs:
* You can define a limit for the total size of all files in the directory: max_wal_size. If it is reached, PostgreSQL performs an automatic CHECKPOINT operation.
* You can define a checkpoint_timeout in seconds. No later than this number of seconds, PostgreSQL performs an automatic CHECKPOINT operation.
In both cases the shared buffers get written to disc, a checkpoint-record is written to the actual WAL file and all older WAL files are ready to be deleted.
The deletion of WAL files may be prevented by other criteria, especially by failing archive commands. max_wal_size is a soft limit and can silently be exceeded by the system in such situations.
# PostgreSQL/Upgrade

When upgrading the PostgreSQL software, you must take care of the data in the cluster - depending on the question whether it is an upgrade of a major or a minor version. The PostgreSQL version number consists of two or three groups of digits, divided by colons. The first two groups denotes the major version and the third group (if present) denotes the minor version.
Upgrades within minor versions are simple. The internal data format does not change, so you only need to install the new software while the instance is down.
Upgrades of major versions may lead to incompatibilities of internal data structures. Therefore special actions may become necessary. There are several strategies to overcome the situation. In many cases upgrades of major versions additionally introduce some user-visible incompatibilities, so application programming changes might be required. You should read the release notes carefully.

## pg_upgrade

pg_upgrade is a utility which modifies data files and system catalogs according to the needs of the new version. It has two major behaviors: In --link mode files are modified in place, otherwise the files are copied to a new location.

## pg_dumpall

pg_dumpall is a standard utility to generate logical backups of the cluster. Files generated by pg_dumpall are plain text files and thus independent from all internal structures. When modifications of the data's internal structure become necessary (upgrade, different hardware architecture, different operating system, ...), such logical backups can be used for the data transfer from the old to the new system.

## Replication

The Slony replication system offers the possiblity to transfer data over different major versions. Using this, you can switch a replication slave to the new master within a very short time frame.
PostgreSQL offers replication in logical streaming format. With the actual version 9.5 this feature is restricted to the same versions of master and standby server, but it is planned to extend it for use in a heterogenuous server landscape.
# PostgreSQL/Visibility Map and Free Space Map

Every table is stored in a separate disk file. The names of such files consist of numbers which are the internal Object Identifiers (OID) of the table used in the System Catalog. Each such file is accompanied by a file for its Visibility Map and another one for its Free Space Map. They have the same names expanded by the suffix '_vm' respectively '_fsm'. An example for such a triplet of filenames is: 3083, 3083_vm, and 3083_fsm.
The two additional files contain metainformation to optimize I/O activities to the original file - especially for vacuuming and freezing, but also for other write activities. Because I/O works per physical page, the metainformation addresses complete physical pages, not any part of pages like rows or versions.

#### Visibility Map

The Visibility Map contains two flags — stored as two bits — for each page of the original file. The first bit indicates that the associated page contains only valid row versions, i.e. there is no bloat to be vacuumed. The second bit indicates that the page only contains already frozen row versions.
Please consider two details. First, in most cases a page contains many rows or row versions. However, both flags are associated with the page, not with an individual row or row version. The flags are set only under the condition that they are valid for ALL row versions stored on the page. Second, since there are only two bits per page (2 bits correlate to 8 kiloBytes, which is a relation of about 1 : 32.000), the Visibility Map is considerably smaller than the original file.
VACUUM and Autovacuum set the flags. Every write operation on any row version of the page clears the flags.
The Visibility Map helps VACUUM and Autovacuum to save unnecessary I/O. When the first bit is set, it's unnecessary to read the original page and check its content for removing bloat. It's clear that there is no bloat. Correspondingly, if VACUUM or Autovacuum have to perform freezing of rows, they can skip pages where the second bit signals that the page only contains already frozen row versions - no freeze is necessary.

#### Free Space Map

The Free Space Map tracks the amount of free, unused space per page. It is organized as a highly condensed B-tree of (rounded) free space size per page.
VACUUM and Autovacuum change the Free Space Map according to their write operations (marking of row versions as 'obsolete' and rearranging the physical layout of pages). Other write operations consult the Free Space Map to locate pages with enough free space for the intended write operations and change the Free Space Map afterward.
# Pokémon/Pokédex/Rolycoly
## Description

A coal-like pokémon.

## Base Statistics

A Rock type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Rolycoly: water, grass, fighting, ground, steel Moves that deal 50% of their damage to Rolycoly: normal, fire, poison, flying
# Pokémon/Pokédex/Rowlet
## Description

A owllike pokémon.

## Base Statistics

A Grass and Flying type Pokémon.

## Type Matching

Moves that deal 400% of their damage to Rowlet: ice Moves that deal 200% of their damage to Rowlet: fire, poison, rock Moves that deal 50% of their damage to Rowlet: water, ground, fighting Moves that deal 25% of their damage to Rowlet: grass Moves that deal 0% of their damage to Rowlet: ground
# Pokémon/Pokédex/Rockruff
## Description

A doglike pokémon.

## Base Statistics

A Rock type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Rockruff: water, grass, fighting, ground, steel Moves that deal 50% of their damage to Rockruff: normal, fire, poison, flying
# Pokémon/Pokédex/Roserade
## Description

A rose-like pokémon.

## Base Statistics

A Grass and Poison type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Roserade: fire, ice, flying, psychic Moves that deal 50% of their damage to Roserade: water, electric, fighting, fairy Moves that deal 25% of their damage to Roserade: grass
# Pokémon/Pokédex/Riolu
## How to Evolve

Riolu evolves into Lucario.
# Pokémon/Pokédex/Rookidee
## Description

A birdlike pokémon.

## Base Statistics

A Flying type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Rookidee: electric, ice, rock Moves that deal 50% of their damage to Rookidee: grass, fighting, bug Moves that deal 0% of their damage to Rookidee: ground

## Notes

Introduced in Pokémon Sword and Pokémon Shield.
# Pokémon/Pokédex/Rotom
## Description

An orange and cyan pokémon.

## Base Statistics

A Electric and Ghost type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Rotom: ground, ghost, dark Moves that deal 50% of their damage to Rotom: electric, flying, steel, poison, bug Moves that deal 0% of their damage to Rotom: normal, fighting
# Pokémon/Pokédex/Rhyperior
## Description

A bipedal pokémon.

## Base Statistics

A ground and rock type Pokémon.

## Type Matching

Moves that deal 400% of their damage to Rhyperior: water, grass Moves that deal 200% of their damage to Rhyperior: ice, fighting, ground, steel Moves that deal 50% of their damage to Rhyperior: rock, normal, fire, flying Moves that deal 25% of their damage to Rhyperior: poison Moves that deal 0% of their damage to Rhyperior: electric

## How to Evolve

Evolves from Rhydon with the Protector item.

## Name

Name draws from the word "Superior"
# Pokémon/Pokédex/Roselia
## Basic Statistics

* National Index: 315
* Johto Index: 315
* Hoenn Index: 94
* Stage: Basic
* Height: 0.3m/1'0"
* Weight: 2kg/4.0lb
* Gender Distribution: 50% Male
* Ability: Natural Cure/Poison Point
* Type: Grass/Poison
* Species: Thorn
* Egg Group: Fairy/Plant
* Hatch Steps: 5120
* Catch Rate: 150
* Base Experience: 152
* Max Experience: 1059860
| | HP | Attack | Defense | Speed | Special Attack | Special Defense |
| Base Stats (RB/Y) | - | - | - | - | - | - |
| Base Stats (GS/C) | - | - | - | - | - | - |
| Base Stats (RS/FL/E) | 50 | 60 | 45 | 65 | 100 | 80 |
| Base Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Base Stats (BW/B2W2) | – | – | – | – | – | – |
| Base Stats (XY/ORAS) | – | – | – | – | – | – |
| Base Stats (SM/USUM) | – | – | – | – | – | – |
| Base Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Max Stats (RB/Y) | - | - | - | - | - | - |
| Max Stats (GS/C) | - | - | - | - | - | - |
| Max Stats (RS/FL/E) | 304 | 240 | 207 | 251 | 328 | 284 |
| Max Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Max Stats (B/W/B2W2) | – | – | – | – | – | – |
| Max Stats (X/Y/ORAS) | – | – | – | – | – | – |
| Max Stats (SM/USUM) | – | – | – | – | – | – |
| Max Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Effort Points (Sword/Shield/BDSP) | – | – | – | – | – | – |

## Type Matching

Move types which are good on Roselia: Fire, Flying, Ice, Psychic Move types which are bad on Roselia: Electric, Fighting, Water Move types which are very bad on Roselia: Grass
All other move types are normal effectiveness on Roselia.

## Moveset

| Level | Ruby / Sapphire | Fire Red / Leaf Green |
| Start | Absorb | Absorb |
| 5 | Growth | Growth |
| 9 | Poison Sting | Poison Sting |
| 13 | Stun Spore | Stun Spore |
| 17 | Mega Drain | Mega Drain |
| 21 | Leech Seed | Leech Seed |
| 25 | Magical Leaf | Magical Leaf |
| 29 | Grasswhistle | Grasswhistle |
| 33 | Giga Drain | Giga Drain |
| 37 | Sweet Scent | Sweet Scent |
| 41 | Ingrain | Ingrain |
| 45 | Toxic | Toxic |
| 49 | Petal Dance | Petal Dance |
| 53 | Aromatherapy | Aromatherapy |
| 57 | Synthesis | Synthesis |

### TM/HM

* RS/FL: Attract, Bullet Seed, Cut, Double Team, Facade, Flash, Frustration, Giga Drain, Hidden Power, Protect, Rest, Return, Secret Power, Shadow Ball, Sludge Bomb, Solarbeam, Sunny Day, Toxic

### Breeding

* RS/FL: Cotton Spore, Pin Missile, Spikes, Synthesis

## Trading Cards

* EX Dragon #9 - Roselia
# Pokémon Trading Card Game/Fossil
## Dragonite

* Type: Colorless
* HP: 100
* Retreat: 1 Colorless
* Weakness: -
* Resistance: Fighting -30

### Pokémon Power: Step In

Before attacking, if Dragonite is on your Bench, you can switch it with your Active Pokémon.

### Slam

* Energy: 4 Colorless
* Damage: 40x
* Text: Flip 2 coins. This attack does 40 damage times the number of heads.
# Pokémon Trading Card Game/Gym Heroes

Gym Heroes is the 6th set of the Pokémon TCG. It was released on August 14, 2000 in the United States and had 2 printing. The set has 132 cards.
The Card List:
* Blaine’s Moltres
* Brock’s Rhydon
* Erika’s Clefable
* Erika’s Dragonair
* Erika’s Vileplume
* Lt. Surge’s Electabuzz
* Lt. Surge’s Fearow
* Lt. Surge’s Magneton
* Misty’s Seadra
* Misty’s Tentacruel
* Rocket’s Hitmonchan
* Rocket’s Moltres
* Rocket’s Scyther
* Sabrina’s Gengar
* Brock
* Erika
* Lt. Surge
* Misty
* The Rocket’s Trap
* Brock’s Golem
* Brock’s Onix
* Brock’s Rhyhorn
* Brock’s Sandslash
* Brock’s Zubat
* Erika’s Clefairy
* Erika’s Victreebel
* Lt. Surge Electabuzz
* Lt. Surge Raichu
* Misty’s Cloyster
* Misty’s Goldeen
* Misty’s Poliwrath
* Misty’s Tentacool
* Rocket’s Snorlax
* Sabrina’s Venomoth
* Blaine’s Growlithe
* Blaine’s Kangaskhan
* Blaine’s Magmar
* Brock’s Geodude
* Brock’s Golbat
* Brock’s Graveler
* Brock’s Lickitung
* Erika’s Dratini
* Erika’s Exeggcute
* Erika’s Exeggutor
* Erika’s Gloom
* Erika’s Gloom
* Erika’s Oddish
* Erika’s Weepinbell
* Erika’s Weepinbell
* Lt. Surge’s Magnemite
* Lt. Surge’s Raticate
* Lt. Surge’s Spearow
* Misty’s Poliwhirl
* Misty’s Psyduck
* Misty’s Seaking
* Misty’s Starmir
* Misty’s Tentacool
* Sabrina’s Haunter
* Sabrina’s Jynx
* Sabrina’s Slowbro
* Blaine’s Charmander
* Blaine’s Growlithe
* Blaine’s Ponyta
* Blaine’s Tauros
* Blaine’s Vulpix
* Brock’s Geodude
* Brock’s Mankey
* Brock’s Mankey
* Brock’s Onix
* Brock’s Rhyhorn
* Brock’s Sandshrew
* Brock’s Sandshrew
* Brock’s Vulpix
* Brock’s Zubat
* Erika’s Bellsprout
* Erika’s Bellsprout
* Erika’s Exeggcute
* Erika’s Oddish
* Erika’s Tangela
* Lt. Surge’s Magnemite
* Lt. Surge’s Pikachu
* Lt. Surge’s Rattata
* Lt. Surge’s Spearow
* Lt. Surge’s Voltorb
* Misty’s Goldeen
* Misty’s Horsea
* Misty’s Poliwag
* Misty’s Seel
* Misty’s Shellder
* Misty’s Staryu
* Sabrina’s Abra
* Sabrina’s Drowzee
* Sabrina’s Gastly
* Sabrina’s Mr. Mime
* Sabrina’s Slowpoke
* Sabrina’s Venonat
* Blaine’s Quiz #1
* Brock
* Charity
* Erika
* Lt. Surge
* Misty
* No Removal Gym
* The Rocket’s Training Gym
* Blaine’s Last Resort
* Brock’s Training Method
* Celadon City Gym
* Cerulean City Gym
* Erika’s Maids
* Erika’s Perfume
* Good Manners
* Lt. Surge’s Treaty
* Minion of Team Rocket
* Misty’s Wrath
* Pewter City Gym
* Recall
* Sabrina’s ESP
* Secret Mission
* Tickling Machine
* Vermilion City Gym
* Blaine’s Gamble
* Energy Flow
* Misty’s Duel
* Narrow Gym
* Sabrina’s Gaze
* Trash Exchange
* Fighting Energy
* Fire Energy
* Grass Energy
* Lighting Energy
* Psychic Energy
* Water Energy
# Pokémon Trading Card Game

Welcome to the Wikibooks Guide to the Pokémon Trading Card Game. This guide is part of the Wikibooks Pokémon guide.

## Main Table of Contents
### Basics

    Learn the basics of the Pokémon Trading Card Game.

### Card Indices

The following indices are lists of Pokémon Trading Cards, organized by set. All Pokémon cards link to their entries in the Wikibooks Pokédex if the card is described in the entry pages.

#### Wizards of the Coast Sets

* Base Set
* Jungle
* Fossil
* Team Rocket
* Gym Heroes
* Gym Challenge
* Neo Geneis
* Neo Discovery
* Neo Revelation
* Neo Destiny
* Expedition
* Aquapolis
* Skyridge

#### Nintendo Sets

* EX Ruby and Sapphire
* EX Sandstorm
* EX Dragon
* EX Team Magma vs. Team Aqua
* EX Hidden Legends
* EX FireRed and LeafGreen
* EX Hidden Legends
* EX Team Rocket Returns
* EX Deoxys

#### Cards by category

* Baby Pokémon
* Basic Pokémon
* Colorless Pokémon
* Darkness Pokémon
* Energy Cards
* Fighting Pokémon
* Fire Pokémon
* Grass Pokémon
* Lightning Pokémon
* Metal Pokémon
* Pokémon-EX Cards
* Pokémon with owners
* Pokémon Tools
* Psychic Pokémon
* Stadium Cards
* Stage 1 Pokémon
* Stage 2 Pokémon
* Supporter Cards
* Technical Machines
* Trainer Cards
* Water Pokémon
# Pokémon Trading Card Game/EX Ruby and Sapphire

* Aggron
* Beautifly
* Blaziken
* Camerupt
* Delcatty
* Dustox
* Gardevoir
* Hariyama
* Manectric
* Mightyena
* Sceptile
* Slaking
* Swampert
* Wailord
* Blaziken
* Breloom
* Donphan
* Nosepass
* Pelipper
* Sceptile
* Seaking
* Sharpedo
* Swampert
* Weezing
* Aron
* Cascoon
* Combusken
* Combusken
* Delcatty
* Electrike
* Grovyle
* Grovyle
* Hariyama
* Kirlia
* Kirlia
* Lairon
* Lairon
* Linoone
* Manectric
* Marshtomp
* Marshtomp
* Mightyena
* Silcoon
* Skitty
* Slakoth
* Swellow
* Vigoroth
* Wailmer
* Aron
* Aron
* Carvanha
* Electrike
* Electrike
* Koffing
* Goldeen
* Makuhita
* Makuhita
* Makuhita
* Mudkip
* Mudkip
* Numel
* Phanpy
* Poochyena
* Poochyena
* Poochyena
* Ralts
* Ralts
* Ralts
* Shroomish
* Skitty
* Skitty
* Taillow
* Torchic
* Torchic
* Treecko
* Treecko
* Wingull
* Wurmple
* Zigzagoon
* Energy Removal 2
* Energy Restore
* Energy Switch
* Lady Outing
* Lum Berry
* Oran Berry
* Poké Ball
* Pokémon Reversal
* PokéNav
* Professor Birch
* Energy Search
* Potion
* Switch
* Darkness Energy
* Metal Energy
* Rainbow Energy
* Chansey ex
* Electabuzz ex
* Hitmonchan ex
* Lapras ex
* Magmar ex
* Mewtwo ex
* Scyther ex
* Sneasel ex
* Grass Energy
* Fighting Energy
* Water Energy
* Psychic Energy
* Fire Energy
* Lightning Energy
# Pokémon Trading Card Game/Fire Pokémon

Fire Types Weaknesses
Fire type Pokémon have a weakness of water, rock and ground type Pokémon which means that they get dealt twice the damage from those types of Pokémon
Fire Types Strength
Fire types Pokémon are Stronger then ice, grass, bug and steel type Pokémon which means that can inflict twice the damage of those types of Pokémon.
# Pokémon Trading Card Game/Base Set

Base set is the first set of the Pokémon TCG. The first print was released on January 9th, 1999 in the United Stares and would have three more printing. This set contains 102 cards.
Trading Card List:
* Alakazam
* Blastoise
* Chansey
* Charizard
* Clefairy
* Gyarados
* Hitmonchan
* Machamp
* Magneton
* Mewtwo
* Nidoking
* Ninetales
* Poliwrath
* Raichu
* Venusaur
* Zapdos
* Beedrill
* Dragonair
* Dugtrio
* Electabuzz
* Electrode
* Pidgeotto
* Arcanine
* Charmeleon
* Dewgong
* Dratini
* Farfetch'd
* Growlithe
* Haunter
* Ivysaur
* Jynx
* Kadabra
* Kakuna
* Machoke
* Magikarp
* Magmar
* Nidorino
* Poliwhirl
* Porygon
* Raticate
* Seel
* Wartortle
* Abra
* Bulbasaur
* Caterpie
* Charmander
* Diglett
* Doduo
* Drowzee
* Gastly
* Koffing
* Machop
* Magnemite
* Metapod
* Nidoran (Male)
* Onix
* Pidgey
* Pikachu
* Poliwag
* Ponyta
* Rattata
* Sandshrew
* Squirtle
* Starmie
* Staryu
* Tangela
* Voltorb
* Vulpix
* Weedle
* Clefairy Doll
* Computer Search
* Devolution Spray
* Imposter Professor Oak
* Item Finder
* Lass
* Pokémon Breeder
* Pokémon Trader
* Scoop Up
* Super Energy Removal
* Defender
* Energy Retrieval
* Full Heal
* Maintenance
* Plus Power
* Pokémon Center
* Pokémon Flute
* Pokédex
* Professor Oak
* Revive
* Super Potion
* Bill
* Energy Removal
* Gust of Wind
* Potion
* Switch
* Double Colorless Energy
* Fighting Energy
* Fire Energy
* Grass Energy
* Lightning Energy
* Psychic Energy
* Water Energy
# Pokémon Trading Card Game/Basic Pokémon

Basic Pokémon:
Basic Pokémon are the first stage of a Pokémon. You can find this information on the left side of a card that tells you what stage they are. Basic Pokémon are mostly weaker Pokémon. (Other than some GX and EX cards). However, some Pokémon can be evolved into a stronger stage 1 Pokémon. For example a Meowth can evolve into a Persian.
# Pokémon Trading Card Game/Energy Cards

Energy Cards:
Energy Cards are the main way a Pokémon can use an attack or retreat from a battle. Pokémon require a certain amount of energy to use an attack. Some moves only require 1 energy card while others might need 5 cards to pull off an attack. The same can apply to energy when you have to retreat a Pokémon. There are 11 main different types of energy cards that a player can use. They are Colorless, Darkness, Dragon, Fighting, Fairy, Fire, Grass, Lightning, Metal, Psychic, and Water. There are also special energy cards that each have their own effects to them. For example, a card can have something as simple as a Double Dragon Energy to something more complex like giving a certain buff to a type of Pokémon if they are under the right conditions.